Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Added rules for validating that tables have certain columns and for c… #1298
4 times, most recently
Jan 25, 2018
Feb 8, 2018
I don't understand why the complexity of this is needed. As a possible strawman, what's wrong with doing the validation of the table in the operation itself, like we currently do with joins?
Column rules are convenient because most operations are column operations and there are a ton of them, but there are very few operations that take tables as input and if they do, they are (and should be) unrestricted. Sure, we may want to write more operations that takes tables as input, but there aren't so many that having a generic table rule this complex is warranted.
How about this?
We define the following classmethod on the
and that's it. I think we can get pretty far without things like
I don't think there are any operations (yet) where something like
I think the use case you have in mind for the third case--one or more double columns--can be solved by giving it a different API than one that would require such a rule.
The API with this pared down version would be:
rules.table.with_column_subset([ rules.column(name='foo', value_type=dt.timestamp), rules.column(value_type=int32) ])
If what you meant by an int32 column was "exactly one int32 column", that would be another method