Skip to content

✨feat(source-google-drive): Introduce File Based Stream Permissions Reader#55689

Merged
Aldo Gonzalez (aldogonzalez8) merged 6 commits intomasterfrom
aldogonzalez8/source-google-drive/decouple-permissions-methods-in-new-class
Mar 14, 2025
Merged

✨feat(source-google-drive): Introduce File Based Stream Permissions Reader#55689
Aldo Gonzalez (aldogonzalez8) merged 6 commits intomasterfrom
aldogonzalez8/source-google-drive/decouple-permissions-methods-in-new-class

Conversation

@aldogonzalez8
Copy link
Contributor

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) commented Mar 10, 2025

What

Refactors the Google Drive source connector by moving permissions-related functionality from SourceGoogleDriveStreamReader to a dedicated SourceGoogleDriveStreamPermissionsReader class.

This change follows the separation of concerns principle and aligns with the abstract base classes provided by the Airbyte CDK.

TL;DR: we don't need to do things like this in other connectors and want to fix this once CDK PR is merged.

Changes in CDK: https://github.com/airbytehq/airbyte-python-cdk/pull/402/files

How

  • Created new SourceGoogleDriveStreamPermissionsReader class that implements AbstractFileBasedStreamPermissionsReader
  • Moved permission-related methods from SourceGoogleDriveStreamReader:
    • get_file_acl_permissions
    • load_identity_groups
    • file_permissions_schema
    • identities_schema
  • Moved supporting infrastructure:
    • Google service authentication methods
    • API response handling utilities
    • Permission-related helper functions
  • No changes to the actual implementation logic, just reorganization of code

Review guide

  1. source_google_drive/stream_permissions_reader.py - New file containing all permissions-related functionality
  2. source_google_drive/stream_reader.py - removal of permissions-related code

User Impact

  • No user-facing changes
  • All functionality remains exactly the same
  • No changes to configuration or behavior
  • No performance impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

This is a pure refactoring PR that moves code without changing its behavior. Rolling back would simply move the code back to its original location without affecting functionality.

@vercel
Copy link

vercel bot commented Mar 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 12, 2025 5:04pm

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) changed the title feat(source-google-drive): Introduce File Based Stream Permissions Reader ✨feat(source-google-drive): Introduce File Based Stream Permissions Reader Mar 10, 2025
config=config,
state=state,
cursor_cls=DefaultFileBasedCursor,
stream_permissions_reader=SourceGoogleDriveStreamPermissionsReader(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will adjust this in the future to use class members with less complexity and with looser coupling between classes constructing objects of other classes. But for now, this is enough to decouple ACL/Identities method from general reader so we don't block CDK bump/updates on other file-based connectors for which permissions streams are not relevant at the moment.

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) merged commit c3f33a7 into master Mar 14, 2025
27 checks passed
@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) deleted the aldogonzalez8/source-google-drive/decouple-permissions-methods-in-new-class branch March 14, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants