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

Source Google Ads: fix for date range too narrow exception #4807

Closed

Conversation

blotouta2
Copy link
Contributor

@blotouta2 blotouta2 commented Jul 18, 2021

What

Date Range Exception

How

Add support for start and end date calculation for accessing google ads report
resolves #4806

Recommended reading order

  1. x.java
  2. y.python

Pre-merge Checklist

Expand the checklist which is relevant for this PR.

Connector checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • Secrets are annotated with airbyte_secret in the connector's spec
  • Credentials added to Github CI if needed and not already present. instructions for injecting secrets into CI.
  • Unit & integration tests added as appropriate (and are passing)
    • Community members: please provide proof of this succeeding locally e.g: screenshot or copy-paste acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • /test connector=connectors/<name> command as documented here is passing.
    • Community members can skip this, Airbyters will run this for you.
  • Code reviews completed
  • Documentation updated
    • README.md
    • docs/SUMMARY.md if it's a new connector
    • Created or updated reference docs in docs/integrations/<source or destination>/<name>.
    • Changelog in the appropriate page in docs/integrations/.... See changelog example
    • docs/integrations/README.md contains a reference to the new connector
    • Build status added to build page
  • Build is successful
  • Connector version bumped like described here
  • New Connector version released on Dockerhub by running the /publish command described here
  • No major blockers
  • PR merged into master branch
  • Follow up tickets have been created
  • Associated tickets have been closed & stakeholders notified

Connector Generator checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed.

@@ -77,7 +77,7 @@ def get_date_params(stream_slice: Mapping[str, Any], cursor_field: str, end_date
if start_date > pendulum.now():
return start_date.to_date_string(), start_date.add(days=1).to_date_string()

end_date = min(end_date, pendulum.parse(stream_slice.get(cursor_field)).add(months=1))
end_date = max(end_date, pendulum.parse(stream_slice.get(cursor_field)).add(months=1))
Copy link
Contributor

Choose a reason for hiding this comment

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

If we accept your changes, then we will get a lot of unnecessary duplicates.
The code now works in such a way that we read data in one month.
For example, start_date is 2021-03-18, then we will have several requests:

start_date end_date
2021-03-18 2021-04-18
2021-04-19 2021-05-18
2021-05-19 2021-06-18
2021-06-19 2021-07-18
2021-07-19 2021-07-18

This is where the code breaks down

If we well use your changes, then the following situation will be:

start_date end_date
2021-03-18 2021-07-18
2021-04-19 2021-07-18
2021-05-19 2021-07-18
2021-06-19 2021-07-18
2021-07-19 2021-08-18

The problem exists, but change min to max is not the correct solution.

Copy link
Contributor

@yevhenii-ldv yevhenii-ldv left a comment

Choose a reason for hiding this comment

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

Please looks comment.

@yevhenii-ldv
Copy link
Contributor

Hi @blotouta2
I have already added fix to #4788

@keu keu changed the title fix for date range too narrow exception Source Google Ads: fix for date range too narrow exception Jul 21, 2021
@sherifnada
Copy link
Contributor

@blotouta2 I think we should be good to go according to @yevhenii-ldv comments

@sherifnada sherifnada closed this Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

source google ads exception DATE_RANGE_TOO_NARROW
4 participants