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

Solution to issue #273 #279

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jtranquilli
Copy link

The issue is that some functionalities of the Country class expect the input for id to be in lower case, otherwise the 'get' function, for example, returns nothing. The issue is highlighted in #273.

@@ -111,6 +111,7 @@ def get(cls,
id_type: Union[EntityIdentifier, str],
entity_type: Optional[Union[EntityType, str]] = None):
id_type = id_type.value if isinstance(id_type, Enum) else id_type
id_value = id_value.lower() # Convert to lowercase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Ensure that id_value is a string before calling .lower() to avoid potential errors if id_value is None or not a string.

if isinstance(id_value, str):
  id_value = id_value.lower()

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

Successfully merging this pull request may close these issues.

2 participants