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

Make database parameter optional in ConnectionComponents #15511 #15553

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

Ben-Taarit
Copy link
Contributor

closes #15511

@github-actions github-actions bot added bug Something isn't working integrations Related to integrations with other services labels Oct 1, 2024
Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

thank you for the PR @Ben-Taarit - I think we'll need to accommodate this change elsewhere in the code / tests

@@ -103,7 +103,9 @@ class ConnectionComponents(BaseModel):
driver: Union[AsyncDriver, SyncDriver, str] = Field(
default=..., description="The driver name to use."
)
database: str = Field(default=..., description="The name of the database to use.")
database: Optional[str] = Field(
default=None description="The name of the database to use."
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there will be some implications associated with this being optional now

Suggested change
default=None description="The name of the database to use."
default=None, description="The name of the database to use."

Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

this lgtm! there don't appear to be any downstream implications of making database optional here, since in create_url we exclude None values - and it shouldnt be a breaking change

@zzstoatzz zzstoatzz merged commit 43e0bf7 into PrefectHQ:main Oct 1, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integrations Related to integrations with other services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConnectionComponents: Make database optional for proper connection string formation
3 participants