Comments (3)
From the example above, it is probably a good idea to clearly isolate the columns, so that Schema can contain other objects, such as list of valid values used in validate
.
class Columns:
col1 = "column_1_name"
col2 = ...
class Schema:
@classmethod
def validate(cls) -> None:
pass
@classmethod
def example(cls) -> object:
pass
Things that should work (need to check):
- class inheritance of both Columns and Schema
- definition starting from pandera schema
from dac.
I checked and everything works as expected. If one has a pandera SchemaModel/DataFrameModel, can simply do
class PASchema(pa.DataFrameModel):
...
Columns = PASchema
Schema = PASchema
Obviously in this way there are some "side effects" (Columns
will have methods like evaluate
and example
, and Schema
will contain the column names), but I think it is ok. Potentially one could do something more sophisticated to separate the two.
The idea is to set Columns
and Schema
as Protocols in the dac
library, to allow as much freedom as wanted to the users.
from dac.
Eventually I realized that I could not include Columns
(actually, should have named it Fields
anyway, to account for non-tabular data), because there is no simple way to check that it is provided correctly.
compatibility with pandera schemas is guaranteed.
from dac.
Related Issues (8)
- `load.py` and `schema.py` examples from cli HOT 1
- Support `load.py` and `schema.py` as templates with values injected during `dac pack`
- Open to the possibility of passing optional arguments to `load()` HOT 1
- `Schema.example()` is verified during `dac pack`
- Make dac independent from pydantic
- `dac next-v`
- Expose load and schema modules 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 dac.