-
Notifications
You must be signed in to change notification settings - Fork 97
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
Lowercase all names passed into StructuredLinkableSpecName
#1394
Conversation
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'm approving to unblock the various cross-repo wrangling we're trying to get in place, but this change needs a follow-up as it introduces a bunch of subtle issues with this class that will crop up over time. It's up to you whether to do this before merge or separately.
self.element_name = element_name.lower() | ||
self.time_granularity_name = time_granularity_name.lower() if time_granularity_name else None | ||
self.date_part = date_part | ||
|
||
def __post_init__(self) -> None: |
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.
This is a dataclass construct and will no longer be called. Let's merge the remaining bits into __init__
and then remove this method.
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.
Oooh TIL!! I thought this applied to all Python classes!
@@ -29,6 +27,18 @@ class StructuredLinkableSpecName: | |||
time_granularity_name: Optional[str] = None | |||
date_part: Optional[DatePart] = None |
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.
Let's remove these and define property accessor methods instead.
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.
Oops that was just an oversight 🤦♀️ We shouldn't need to add property methods, having public attributes in the init should cover it.
Actually ignore the enum validation stuff and just delete post init. I found out how to verify enum structure so we'll fix that in DSI. |
Per title - lowercase all inputs to avoid errors later.