Comments (5)
Can you elaborate on that? I would like to know use cases with base classes of each artifacts respectibly.
In reality, generated classes for dbt artifacts don't directly inherit BaseModel
so that we can implement something common among the classes of artifacts. However, I haven't seen any cases for that.
from dbt-artifacts-parser.
My use case is that I'm looking to build a tool which exposes the artifacts via a GraphQL API (https://github.com/judahrand/dbt-metadata-api). My first pass is trying to replicate the dbt Metadata API, though I'm not sure this is the best approach...
During development it is handy to hand type hints sort themselves out so that one gets autocomplete on them. For now I've just defined my own Union[ManifestV5, ManifestV6, ManifestV7]
type and used that. This might even be the best approach... However, I also wonder if it would be possible to define a BaseManifest
which is an abstract class which defines the common functionality between all the other classes?
from dbt-artifacts-parser.
@judahrand Thank you for the explanation. I see your point.
I'm not sure whether or not that works by using something like BaseManifest
. As you know, we take advantage of datamodel-codegen
commands in the datamodel-code-generator
module to generate pydantic-based classes. Even a classe to a nested field inherit a specified base class. Since we pass the BaseParserClass
class to datamodel-codegen
commands in our case, all nested fields inherit the class. I am worried about type hinting gets confused due to a lot of inherited different classes.
If you are sure it wold work to create abstract classes by artifact type, I don't mind to refactor the code generation.
from dbt-artifacts-parser.
Unfortunately, at the moment I've moved away from using this package and instead am using dbt-core
to parse the artifacts so I don't think I'll have much time to look into this.
from dbt-artifacts-parser.
Alright. Let's close the issue.
from dbt-artifacts-parser.
Related Issues (12)
- Support dbt manifest.json version 6 HOT 1
- [Feature request] Support for ManifestV7 HOT 2
- Support v8 manifest
- Show a list of contributors in README
- Validation errors for dbt > 1.4.1 HOT 7
- add support for `manifest_v9.json` HOT 2
- Security Policy violation SECURITY.md HOT 148
- ManifestV10 parsing errors on full 1.6 release HOT 1
- Support pydantic 2 HOT 7
- resource_type not defined correctly for manifest v11 HOT 4
- none is not an allowed value: sources -> source.default.xyz -> metadata -> type HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbt-artifacts-parser.