Giter VIP home page Giter VIP logo

Comments (3)

francesco086 avatar francesco086 commented on August 16, 2024

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.

francesco086 avatar francesco086 commented on August 16, 2024

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.

francesco086 avatar francesco086 commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.