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

Introduce Type Alias for Patterns and more #2776

Closed
noklam opened this issue Jul 6, 2023 · 2 comments
Closed

Introduce Type Alias for Patterns and more #2776

noklam opened this issue Jul 6, 2023 · 2 comments

Comments

@noklam
Copy link
Contributor

noklam commented Jul 6, 2023

Background

As a follow up action, we agreed to introduce type like Patterns = Dict[str, Dict[str, Any]] to improve the readability of the code a lot.

An example can be found here

We can also do this beyond just Patterns but to more complicated types within the code base.

As discussed, let's separate the Type Alias proposed in #2770.
I will close #2770 and approve this PR now. :)

Originally posted by @noklam in #2635 (comment)

@noklam
Copy link
Contributor Author

noklam commented Jul 7, 2023

This could be nicely rewritten to:

matches = (parse(pattern, data_set_name) for pattern in data_set_patterns.keys())
return next(filter(None, matches), None)

Originally posted by @idanov in #2635 (comment)

There are some minor refactoring work linked here, we can address this with this change.

@noklam
Copy link
Contributor Author

noklam commented Jul 31, 2023

Closed with #2779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant