8000 feat: create alias alloydbconnector package by rhatgadkar-goog · Pull Request #451 · GoogleCloudPlatform/alloydb-python-connector · GitHub
[go: up one dir, main page]

Skip to content

feat: create alias alloydbconnector package #451

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

Merged
merged 11 commits into from
May 9, 2025
Merged

Conversation

rhatgadkar-goog
Copy link
Collaborator
@rhatgadkar-goog rhatgadkar-goog commented May 6, 2025

This PR creates a new package: google.cloud.alloydbconnector, which is an alias to google.cloud.alloydb.connector. The implementation resides in google.cloud.alloydbconnector, and google.cloud.alloydb.connector points to it.
So importing google.cloud.alloydbconnector is the same as importing google.cloud.alloydb.connector.

This PR aims to fix googleapis/google-cloud-python#13871, where a PEX environment, containing google-cloud-alloydb and alloydb-python-connector packages, fails to import google.cloud.alloydb.connector, because it attempts to find a connector/ directory under the google-cloud-alloydb package, which does not exist. The fix is that the user should import the google.cloud.alloydbconnector package instead.

This PR also updates the README and integration tests to mention importing google.cloud.alloydbconnector instead of google.cloud.alloydb.connector. This serves as documentation so that new users of the library will instead import google.cloud.alloydbconnector. Existing users can continue to import google.cloud.alloydb.connector without any issues.

@rhatgadkar-goog rhatgadkar-goog marked this pull request as ready for review May 7, 2025 19:18
@rhatgadkar-goog rhatgadkar-goog requested a review from a team as a code owner May 7, 2025 19:18
@rhatgadkar-goog rhatgadkar-goog requested a review from enocom May 7, 2025 19:18
@rhatgadkar-goog rhatgadkar-goog requested a review from enocom May 7, 2025 21:25
Copy link
Member
@enocom enocom left a comment

Choose a reason for hiding this comment

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

👏

@enocom
Copy link
Member
enocom commented May 7, 2025

@jackwotherspoon would you mind taking a quick pass on this?

@enocom enocom requested a review from jackwotherspoon May 7, 2025 21:37
@rhatgadkar-goog rhatgadkar-goog changed the title feat: create alias alloydb_connector package feat: create alias alloydbconnector package May 9, 2025
@rhatgadkar-goog rhatgadkar-goog merged commit 14509e8 into main May 9, 2025
15 checks passed
@rhatgadkar-goog rhatgadkar-goog deleted the alias-package branch May 9, 2025 21:08
@jackwotherspoon
Copy link
Collaborator

This naming of alloydbconnector is a really bad idea in my mind.

When readability is improved, underscores can be used to separate words. - PEP 8

In my mind this is a clear case where readability is improved by having the package name google.cloud.alloydb_connector

@rhatgadkar-goog
Copy link
Collaborator Author

This naming of alloydbconnector is a really bad idea in my mind.

When readability is improved, underscores can be used to separate words. - PEP 8

In my mind this is a clear case where readability is improved by having the package name google.cloud.alloydb_connector

That makes sense. But I don't think the google cloud python repo has strict guidelines on this. So I think it's okay if we keep this change to have the package name without underscores. For example, The org-policy package name is not separated with underscores: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-org-policy/google/cloud.

@jackwotherspoon
Copy link
Collaborator

That makes sense. But I don't think the google cloud python repo has strict guidelines on this. So I think it's okay if we keep this change to have the package name without underscores. For example, The org-policy package name is not separated with underscores: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-org-policy/google/cloud.

Just because "X" does it does not mean it is the right way.

LangChain integrations are using underscores... https://github.com/googleapis/langchain-google-cloud-sql-pg-python/tree/main/src/langchain_google_cloud_sql_pg

@rhatgadkar-goog
Copy link
Collaborator Author

That makes sense. But I don't think the google cloud python repo has strict guidelines on this. So I think it's okay if we keep this change to have the package name without underscores. For example, The org-policy package name is not separated with underscores: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-org-policy/google/cloud.

Just because "X" does it does not mean it is the right way.

LangChain integrations are using underscores... https://github.com/googleapis/langchain-google-cloud-sql-pg-python/tree/main/src/langchain_google_cloud_sql_pg

Alright. I'll change the package name to alloydb_connector to maintain consistency in naming formats between AlloyDB and CloudSQL.

@enocom
Copy link
Member
enocom commented May 14, 2025

For posterity, we stuck with alloydbconnector.

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.

google.cloud.alloydb PEP 420 namespace issue
3 participants
0