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

feat(airbyte-cdk): add custom decoder #48450

Closed
wants to merge 2 commits into from

Conversation

artem1205
Copy link
Collaborator

What

resolving amazon ads low-code async migration

add custom decoder to implement gzip jsonl decoder

How

add custom decoder

Review guide

  1. airbyte-cdk/python/airbyte_cdk/sources/declarative/declarative_component_schema.yaml
  2. airbyte-cdk/python/airbyte_cdk/sources/declarative/models/declarative_component_schema.py
  3. airbyte-cdk/python/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

User Impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
@artem1205 artem1205 self-assigned this Nov 11, 2024
Copy link

vercel bot commented Nov 11, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Nov 11, 2024 4:35pm

@artem1205 artem1205 requested a review from a team November 11, 2024 14:36
@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Nov 11, 2024
type: string
additionalProperties: true
examples:
- "source_amazon_ads.components.GzipJsonlDecoder"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not put this in the CDK? It feels like an interesting pattern that could be composed (for example, GZIP with JSONL or GZIP with CSV)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Amazon ads has some specific decompress with utf :

response = self._send_http_request(url=url, profile_id=profile_id, is_download_report=True)
response.raise_for_status()
raw_string = decompress(response.content).decode("utf")
return json.loads(raw_string)

I can add a GzipJsonDecoder with optional encoding field (I guess it would be utf-8 by default). WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense to me, thanks @artem1205 !

Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
@artem1205
Copy link
Collaborator Author

moved to airbytehq/airbyte-python-cdk#20

@artem1205 artem1205 closed this Nov 11, 2024
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