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

Connector builder: handle empty catalog #24184

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

clnoll
Copy link
Contributor

@clnoll clnoll commented Mar 17, 2023

What

Fixes an issue where the CDK attempts to validate an empty catalog on requests where the catalog is not needed.

Why

The Connector Builder server has two request types that don't require a catalog: resolve_manifest and list_streams. For these, the filepath provided in the --catalog argument points to an empty catalog. We don't actually want or need to try to validate the catalog, so let's skip it, to avoid unnecessary file reads if nothing else.

@clnoll clnoll requested a review from a team as a code owner March 17, 2023 12:35
@clnoll clnoll requested a review from girarda March 17, 2023 12:35
@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Mar 17, 2023
def handle_connector_builder_request(source: ManifestDeclarativeSource, config: Mapping[str, Any], catalog: ConfiguredAirbyteCatalog):
command = config.get("__command")
def handle_connector_builder_request(
source: ManifestDeclarativeSource, command: str, config: Mapping[str, Any], catalog: Optional[ConfiguredAirbyteCatalog]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: read_stream expects catalog to be non-None, so we should validate its presence before passing it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good call. I didn't see this before I hit merge so will open a new one for that.

@clnoll clnoll merged commit e890d01 into master Mar 17, 2023
@clnoll clnoll deleted the connector-builder-handle-empty-catalog branch March 17, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants