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 Amplitude: enable event stream time interval selection #21022

Conversation

mariamthiam
Copy link
Contributor

@mariamthiam mariamthiam commented Jan 4, 2023

What

Enable the possibility to select events stream time interval to resolve issue #21010

How

Add new source parameter event_time_interval to make time interval selectionable for event stream

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and 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.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@mariamthiam mariamthiam changed the title feat(Source Amplitude): enable event stream time interval selection 🎉 Source Amplitude: enable event stream time interval selection Jan 4, 2023
@mariamthiam mariamthiam force-pushed the CSD-348-fix-amplitude-stream-events-query-timelapse branch from b86f8ec to 66b1007 Compare January 4, 2023 18:41
@mariamthiam mariamthiam marked this pull request as ready for review January 4, 2023 18:43
@misteryeo
Copy link
Contributor

Issue was linked to Harvestr Discovery: Source Amplitude: Enable events stream time_interval selection

@sajarin sajarin requested a review from bazarnov January 19, 2023 19:37
@sajarin sajarin added internal and removed bounty labels Jan 19, 2023
@bazarnov bazarnov requested review from lazebnyi, roman-yermilov-gl and a team and removed request for bazarnov January 30, 2023 14:25
Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Some things that will need to be added:

This is probably a minor semver change, as this new config option is optional

@sajarin
Copy link
Contributor

sajarin commented Mar 8, 2023

hey @mariamthiam thanks for the contribution? Can you address the comments above by adding a change log entry and bumping the version in the dockerfile of the connector? Let me know if you need help with this or if you have any questions!

@mariamthiam mariamthiam requested review from evantahler and removed request for lazebnyi, roman-yermilov-gl and evantahler March 21, 2023 13:24
@mariamthiam mariamthiam force-pushed the CSD-348-fix-amplitude-stream-events-query-timelapse branch from f7f4f34 to 27f7679 Compare March 28, 2023 14:22
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Mar 28, 2023
@mariamthiam
Copy link
Contributor Author

mariamthiam commented Mar 28, 2023

@evantahler and @sajarin it's done ✅

@evantahler
Copy link
Contributor

evantahler commented Mar 28, 2023

/test connector=connectors/source-amplitute

🕑 connectors/source-amplitute https://github.com/airbytehq/airbyte/actions/runs/4548554920
❌ connectors/source-amplitute https://github.com/airbytehq/airbyte/actions/runs/4548554920
🐛

Build Failed

Test summary info:

Could not find result summary

@evantahler
Copy link
Contributor

The /test I'm running above did not include updating our config to demonstrate the connector upgrade case. The config in use looks like:

{
    "api_key": "xxx",
    "secret_key": "yyy",
    "start_date": "2023-02-01T00:00:00Z",
    "data_region": "Standard Server"
  }

@mariamthiam mariamthiam force-pushed the CSD-348-fix-amplitude-stream-events-query-timelapse branch from 4f8167a to 12294e2 Compare March 29, 2023 12:57
def __init__(self, data_region: str, **kwargs):
def __init__(self, data_region: str, event_time_interval: dict = None, **kwargs):
if event_time_interval is None:
event_time_interval = {"size_unit": "days", "size": 1}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@evantahler default value is set here

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 lets try the test again!

@sajarin sajarin self-assigned this Mar 29, 2023
@evantahler
Copy link
Contributor

evantahler commented Mar 30, 2023

/test connector=connectors/source-amplitude

🕑 connectors/source-amplitude https://github.com/airbytehq/airbyte/actions/runs/4561004068
❌ connectors/source-amplitude https://github.com/airbytehq/airbyte/actions/runs/4561004068
🐛 https://gradle.com/s/w2mo3cyhpzqzo

Build Failed

Test summary info:

	 =========================== short test summary info ============================
	 FAILED unit_tests/test_source.py::test_streams[Cohorts] - KeyError: 'event_ti...
	 FAILED unit_tests/test_source.py::test_streams[Annotations] - KeyError: 'even...
	 FAILED unit_tests/test_source.py::test_streams[ActiveUsers] - KeyError: 'even...
	 FAILED unit_tests/test_source.py::test_streams[AverageSessionLength] - KeyErr...
	 FAILED unit_tests/test_source.py::test_streams[Events] - KeyError: 'event_tim...
	 �[31m================== �[31m�[1m5 failed�[0m, �[32m34 passed�[0m, �[33m99 warnings�[0m�[31m in 0.90s�[0m�[31m ===================�[0m

@mariamthiam mariamthiam force-pushed the CSD-348-fix-amplitude-stream-events-query-timelapse branch from f378626 to 8e4de5f Compare March 30, 2023 10:08
@mariamthiam
Copy link
Contributor Author

Sorry this should be the last fix can you rerun the tests @evantahler ?

@evantahler
Copy link
Contributor

evantahler commented Mar 30, 2023

/test connector=connectors/source-amplitude

🕑 connectors/source-amplitude https://github.com/airbytehq/airbyte/actions/runs/4566014275
✅ connectors/source-amplitude https://github.com/airbytehq/airbyte/actions/runs/4566014275
Python tests coverage:

Name                           Stmts   Miss  Cover
--------------------------------------------------
source_amplitude/__init__.py       2      0   100%
source_amplitude/source.py        39      2    95%
source_amplitude/errors.py        12      1    92%
source_amplitude/api.py          202     26    87%
--------------------------------------------------
TOTAL                            255     29    89%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:578: The previous and actual discovered catalogs are identical.
================== 39 passed, 1 skipped in 461.38s (0:07:41) ===================

Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

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

🥳 I want to ask one person for a review, and then we can merge this in!

@evantahler
Copy link
Contributor

@bazarnov I pinged you for a PR review, since you recently worked on this connector. I believe that this PR looks good, but I wanted your 👀 on it

Copy link
Collaborator

@bazarnov bazarnov left a comment

Choose a reason for hiding this comment

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

Looks good. LGTM!

@evantahler
Copy link
Contributor

evantahler commented Mar 30, 2023

/publish connector=connectors/source-amplitude

🕑 Publishing the following connectors:
connectors/source-amplitude
https://github.com/airbytehq/airbyte/actions/runs/4567266820


Connector Did it publish? Were definitions generated?
connectors/source-amplitude

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@evantahler
Copy link
Contributor

Thank you @mariamthiam! I'm getting this published and merged in now.

@evantahler evantahler self-assigned this Mar 30, 2023
@evantahler evantahler merged commit 64a08fa into airbytehq:master Mar 30, 2023
10 of 16 checks passed
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 community connectors/source/amplitude internal
Projects
Development

Successfully merging this pull request may close these issues.

None yet

7 participants