Skip to content

feat(dataconnect): Implemented Data Connect service client and comprehensive test suite#955

Open
mk2023 wants to merge 5 commits into
winefrom
prosecco
Open

feat(dataconnect): Implemented Data Connect service client and comprehensive test suite#955
mk2023 wants to merge 5 commits into
winefrom
prosecco

Conversation

@mk2023

@mk2023 mk2023 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Feat: Implemented the foundational Firebase Data Connect Python SDK architecture (for Milestone 2) and their respective unit/integration tests:

This PR introduces a comprehensive test suite for the firebase_admin.dataconnect module. The tests cover:

  • ConnectorConfig class behavior and validation.
  • DataConnect class initialization.
  • The dataconnect.client() factory function, including caching logic.
  • The internal _DataConnectService client management.

This PR also includes the implementation of the core Data Connect module (firebase_admin/dataconnect.py), designed to maintain architectural parity with the Node.js Admin SDK while leveraging idiomatic Python patterns:

  • ConnectorConfig: Implemented as an immutable frozen dataclass (@dataclass(frozen=True)) with strict input validation that raises idiomatic ValueError exceptions. Because it is frozen, Python automatically generates value-based hashing (__hash__), enabling clean object lookup.
  • DataConnect: Implemented the primary client class with clean property accessors (.app and .config).
  • _DataConnectService & client(): Built instance caching integrated directly into Python's Firebase App service lifecycle (_utils.get_app_service), ensuring duplicate calls return cached instances.

@mk2023 mk2023 requested a review from stephenarosaj June 26, 2026 22:04
@mk2023 mk2023 self-assigned this Jun 26, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the new dataconnect module, including the ConnectorConfig and DataConnect classes, along with a comprehensive test suite. However, the implementation is currently incomplete and will fail the tests. Specifically, the DataConnect class is missing the public app and config properties, the client function is left as a stub, and the _DataConnectService class is completely missing. Additionally, the validation in ConnectorConfig needs to be updated to explicitly check for string types to prevent invalid types from bypassing the checks.

Comment thread firebase_admin/dataconnect.py
Comment thread firebase_admin/dataconnect.py Outdated
Comment thread firebase_admin/dataconnect.py
@stephenarosaj

Copy link
Copy Markdown

it's important that PR/CL titles and descriptions are detailed enough so that reviewers (or future viewers) have the context they need to understand your changes

will you check out go/cl-descriptions for some guidance and examples, and then add an updated description and title for the PR?

@mk2023 mk2023 changed the base branch from wine-m1 to wine June 29, 2026 18:10
@mk2023 mk2023 changed the title Prosecco feat(fdc): Added unit tests for ConnectorConfig, DataConnect Initialization, Data Connect client factory, and _DataConnectService Jun 29, 2026
Comment thread firebase_admin/dataconnect.py
Comment thread firebase_admin/dataconnect.py
Comment thread firebase_admin/dataconnect.py Outdated
Comment thread firebase_admin/dataconnect.py Outdated
Comment thread firebase_admin/dataconnect.py
Comment thread tests/test_data_connect.py Outdated
Comment thread tests/test_data_connect.py Outdated
Comment thread tests/test_data_connect.py Outdated
Comment thread tests/test_data_connect.py Outdated
Comment thread tests/test_data_connect.py Outdated
@mk2023 mk2023 changed the title feat(fdc): Added unit tests for ConnectorConfig, DataConnect Initialization, Data Connect client factory, and _DataConnectService feat(dataconnect): Added unit tests for ConnectorConfig, DataConnect Initialization, Data Connect client factory, and _DataConnectService Jun 29, 2026
mk2023 added 3 commits June 29, 2026 15:32
…d docstrings/synatx

Refactored test suite to use module-level BASE_CONFIG and added parameterized client caching tests.
…ervice architecture

Implemented ConnectorConfig dataclass, DataConnect client instance, _DataConnectService caching layer, and public client() factory function. Fixed mock recursion in test_client_successful using lambda delegation in test_data_connect.py.
@mk2023 mk2023 changed the title feat(dataconnect): Added unit tests for ConnectorConfig, DataConnect Initialization, Data Connect client factory, and _DataConnectService feat(dataconnect): Implemented Data Connect service client and comprehensive test suite Jun 30, 2026
@mk2023 mk2023 requested a review from itsrakhil June 30, 2026 20:56

@itsrakhil itsrakhil left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

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