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 GCS ConnectorTable as mapping-like #955

Merged
merged 6 commits into from
Jun 21, 2024

Conversation

sirosen
Copy link
Member

@sirosen sirosen commented Feb 23, 2024

The ConnectorTable supports the following:

  • class attribute access: ConnectorTable.POSIX
  • classmethod lookup by name: ConnectorTable.lookup("posix")
  • classmethod lookup by ID: ConnectorTable.lookup_by_id("...")
  • classmethod iteration: ConnectorTable.all_connectors()

The name-based lookups are normalized per some basic rules to make
most intelligible strings match.

Autodoc is extended to cover the new ConnectorTable as well as the
dataclass, GlobusConnectServerConnector, which it uses to represent
connector information.


📚 Documentation preview 📚: https://globus-sdk-python--955.org.readthedocs.build/en/955/

Copy link
Contributor

@ada-globus ada-globus left a comment

Choose a reason for hiding this comment

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

I largely approve! One micro change.

src/globus_sdk/services/gcs/connector_table.py Outdated Show resolved Hide resolved
src/globus_sdk/services/gcs/connector_table.py Outdated Show resolved Hide resolved
sirosen and others added 2 commits June 20, 2024 13:32
The `ConnectorTable` supports the following:

- class attribute access: `ConnectorTable.POSIX`
- classmethod lookup by name: `ConnectorTable.lookup("posix")
- classmethod lookup by ID: `ConnectorTable.lookup_by_id("...")`
- classmethod iteration: `ConnectorTable.all_connectors()`

The name-based lookups are normalized per some basic rules to make
most intelligible strings match.

Autodoc is extended to cover the new `ConnectorTable` as well as the
dataclass, `GlobusConnectServerConnector`, which it uses to represent
connector information.
Co-authored-by: Ada <107940310+ada-globus@users.noreply.github.com>
@sirosen sirosen force-pushed the gcs-connector-map branch from 04c9bc5 to 9eb9b9f Compare June 20, 2024 18:32
src/globus_sdk/services/gcs/client.py Outdated Show resolved Hide resolved
src/globus_sdk/services/gcs/connector_table.py Outdated Show resolved Hide resolved
src/globus_sdk/services/gcs/connector_table.py Outdated Show resolved Hide resolved
tests/unit/helpers/gcs/test_connector_table.py Outdated Show resolved Hide resolved
sirosen and others added 2 commits June 20, 2024 14:39
Co-authored-by: Kurt McKee <contactme@kurtmckee.org>
- The content is defined in a large tuple
- The assignment of the tuple contents to the annotated classvar
  attributes is done in a post-class-definition loop
- Tests refer to this tuple (`_connectors`)
- A new test confirms that the tuple is trued-up to any/all
  `GlobusConnectServerConnector` attribute annotations
sirosen and others added 2 commits June 20, 2024 21:08
Co-authored-by: Kurt McKee <contactme@kurtmckee.org>
Rather than supporting lookups by name or ID via different methods,
unify them into a single method per review.

Co-authored-by: Kurt McKee <39996+kurtmckee@users.noreply.github.com>
@sirosen sirosen merged commit 6adfa5b into globus:main Jun 21, 2024
16 checks passed
@sirosen sirosen deleted the gcs-connector-map branch June 21, 2024 03:25
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.

3 participants