Skip to content

✨ feat(Source facebook-marketing): pick fields from configured json schema properties if present - #41039

Merged
Aldo Gonzalez (aldogonzalez8) merged 17 commits into
masterfrom
aldogonzalez8/check_if_configured_catalog_json_schema_is_available_for_fields
Jul 10, 2024
Merged

Aldo Gonzalez (aldogonzalez8) merged 17 commits into
masterfrom
aldogonzalez8/check_if_configured_catalog_json_schema_is_available_for_fields

Conversation

@aldogonzalez8

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) commented Jul 8, 2024 •

Copy link
Copy Markdown
Contributor

What

We have seen errors from facebook API like this:

    {
      "error": {
        "code": 1,
        "message": "Please reduce the amount of data you're asking for, then retry your request"
      }
    }

ref:

We want to provide users the ability to reduce the requested fields, so Artem Inzhyyants (@artem1205) worked with ticket 2100 and the PR 39522 to "add json_schema from ConfiguredCatalog to Stream" and now in ticket 8496 we will implement the new cdk feature to determine the requested fields for facebook-marketing.

How

When calling fields(), check first configured_json_schema; if provided, use properties keys as fields; if not, fallback in current behavior (use stream schema).

DEMO

Review guide

  1. airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_insight_streams.py: add check for self.configured_json_schema
  2. airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams/base_streams.py: add check for self.configured_json_schema
  3. airbyte-integrations/connectors/source-facebook-marketing/pyproject.toml: we need new cdk feature that pass configured_catalog selected fields from platform.
  4. The rest is one unit test per base stream updated.

User Impact

Users will now be able to reduce the requested fields simply checking/unchecking fields from stream configuration.

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

@vercel

vercel Bot commented Jul 8, 2024 •

Copy link
Copy Markdown

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 Jul 10, 2024 4:18pm

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) changed the title ✨ Source Instagram: pick configured json schema properties ad fields if present ✨ Source Facebook: pick configured json schema properties ad fields if present Jul 8, 2024
@aldogonzalez8
Aldo Gonzalez (aldogonzalez8) force-pushed the aldogonzalez8/check_if_configured_catalog_json_schema_is_available_for_fields branch from 8aa9862 to 2a17e19 Compare July 8, 2024 16:28
@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) changed the title ✨ Source Facebook: pick configured json schema properties ad fields if present ✨ Source facebook-marketing: pick configured json schema properties ad fields if present Jul 8, 2024
@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) changed the title ✨ Source facebook-marketing: pick configured json schema properties ad fields if present ✨ Source facebook-marketing: pick fields from configured json schema properties if present Jul 8, 2024

@artem1205 Artem Inzhyyants (artem1205) left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

nit: rename PR to align with Conventional Commits naming (see Notion Page)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@HttpMocker()
def test_request_fields_from_json_schema_in_configured_catalog(self, http_mocker: HttpMocker) -> None:
"""
The purpose of this test is to check that the request fields are the same provided in json_request_schema inside configured catalog

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

<3


| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 3.3.9 | 2024-07-08 | [41039](https://github.com/airbytehq/airbyte/pull/41039) | Pick request fields from configured json schema properties if present |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Aldo Gonzalez (@aldogonzalez8) Artem Inzhyyants (@artem1205) can you also update the docs with instructions for the end-users on how to handle the Please reduce the amount of data you're asking for, then retry your request error?

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) Jul 10, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Alexandre Girard (@girarda) Artem Inzhyyants (@artem1205) I have just updated the documentation. Do you feel comfortable with these instructions and wording?

image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good thank you!

@coderabbitai

coderabbitai Bot commented Jul 10, 2024

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited to specific labels.

Labels to auto review (1)
  • coderabbit-ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) changed the title ✨ Source facebook-marketing: pick fields from configured json schema properties if present ✨ feat(Source facebook-marketing): pick fields from configured json schema properties if present Jul 10, 2024
@aldogonzalez8

Copy link
Copy Markdown
Contributor Author

LGTM!

nit: rename PR to align with Conventional Commits naming (see Notion Page)

Thanks, updated.

This branch was successfully deployed

1 active deployment
Preview — f1009d21 Deployed Jul 10, 2024 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/facebook-marketing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants