Skip to content
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

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

courtneyholcomb
Copy link
Contributor

Per title - lowercase all inputs to avoid errors later.

Copy link
Contributor

@tlento tlento left a 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:
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@tlento
Copy link
Contributor

tlento commented Sep 5, 2024

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.

@courtneyholcomb courtneyholcomb enabled auto-merge (squash) September 5, 2024 18:25
@courtneyholcomb courtneyholcomb merged commit aa0fb35 into main Sep 5, 2024
15 checks passed
@courtneyholcomb courtneyholcomb deleted the court/lower branch September 5, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants