-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Add name string property to dy.Column
#52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
alias string property to dy.Column
alias string property to dy.Columnalias string property to dy.Column
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #52 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 2148 2153 +5
=========================================
+ Hits 2148 2153 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
borchero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one thought: could we somehow make .col and .alias (or something like .name) be populated dynamically? Specifically, we could overwrite __getattr__ (or __getattribute__, I always forget what's the right one) of Schema and set the column name there, i.e.
def __getattr__(self, name: str) -> Any:
val = super().__getattr__(name)
if isinstance(val, Column):
val.name = val.alias or name
return valThat would also allow fixing the problem that we had discussed previously where you can't set the column of a schema based on the column of another schema, i.e. something like
column = OtherSchema.column_with_other_namealias string property to dy.Columnname string property to dy.Column
borchero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Motivation
Fixes #51.
Changes
Add dynamic
nameproperty tody.Column.