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

Allow getting by ID in /api/project/_/fleets/get #2200

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

jvstme
Copy link
Collaborator

@jvstme jvstme commented Jan 20, 2025

Part of #2133

@jvstme jvstme requested a review from r4victor January 20, 2025 00:35
async def get_fleet_by_name(
session: AsyncSession, project: ProjectModel, name: str
async def get_fleet(
session: AsyncSession, project: ProjectModel, name: Optional[str], id: Optional[uuid.UUID]
Copy link
Collaborator

Choose a reason for hiding this comment

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

id local variable shadows a Python's built-in. Alternatives: fleet_id or id_

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The id built-in is rarely used, and using id as a parameter name allows for a more concise function signature. But I think some IDEs and linters don't like it when built-ins are shadowed, so I'll rename it.

@r4victor
Copy link
Collaborator

I suppose it should also handle backward compatibility for new clients with old servers similar to this fix #2174

@jvstme jvstme requested a review from r4victor January 20, 2025 12:42
@jvstme jvstme merged commit e3c221f into master Jan 21, 2025
24 checks passed
@jvstme jvstme deleted the issue_2133_get_fleet_by_id branch January 21, 2025 08:32
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