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 Mixpanel: add insert_id to export stream schema to have a unique event identifier #21837

Conversation

jeremySrgt
Copy link
Contributor

@jeremySrgt jeremySrgt commented Jan 25, 2023

What

This change add the "insert_id" Mixpanel's property to the default schema of the export stream. Since the insert_id field act as a unique identifier to an event, we need it to perform deduplication. Related issue #21460

How

Adding insert_id to the export schema

  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "event": {
      "type": ["null", "string"]
    },
    "distinct_id": {
      "type": ["null", "string"]
    },
    "insert_id": {
      "type": ["null", "string"]
    },
    "time": {
      "type": ["null", "string"],
      "format": "date-time"
    },
    "labels": {
      "type": ["null", "array"],
      "items": {
        "type": ["null", "string"]
      }
    },
    "sampling_factor": {
      "type": ["null", "integer"]
    },
    "dataset": {
      "type": ["null", "string"]
    }
  }
}

Recommended reading order

  1. airbyte-integrations/connectors/source-mixpanel/source_mixpanel/schemas/export.json

🚨 User Impact 🚨

No breaking change, just a new available field when running a sync with the Mixpanel source

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Community member or Airbyter

  • Community member? 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
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • 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 by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
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
Connector Generator
  • 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

Tests

Unit
-- Docs: https://docs.pytest.org/en/stable/warnings.html

Results (0.78s):
      27 passed
Integration
cachedir: .pytest_cache
hypothesis profile 'default' -> configfile: pytest.ini
plugins: hypothesis-6.54.6, requests-mock-1.9.3, mock-3.6.1, sugar-0.9.6, timeout-1.4.2, cov-3.0.0
collecting ... 

Results (0.28s):
Acceptance

Put your acceptance tests output here.

@CLAassistant
Copy link

CLAassistant commented Jan 25, 2023

CLA assistant check
All committers have signed the CLA.

@octavia-squidington-iv octavia-squidington-iv added the area/documentation Improvements or additions to documentation label Jan 25, 2023
@jeremySrgt jeremySrgt changed the title Source Mixpanel: add insert_id to export stream to have a unique event identifier Source Mixpanel: add insert_id to export stream schema to have a unique event identifier Jan 25, 2023
@marcosmarxm
Copy link
Member

marcosmarxm commented Apr 11, 2023

/test connector=connectors/source-mixpanel

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

Name                                         Stmts   Miss  Cover
----------------------------------------------------------------
source_mixpanel/utils.py                         8      0   100%
source_mixpanel/streams/revenue.py              14      0   100%
source_mixpanel/streams/funnels.py              57      0   100%
source_mixpanel/streams/cohorts.py              15      0   100%
source_mixpanel/streams/__init__.py              9      0   100%
source_mixpanel/property_transformation.py      19      0   100%
source_mixpanel/__init__.py                      2      0   100%
source_mixpanel/streams/base.py                 93      3    97%
source_mixpanel/streams/export.py               68      3    96%
source_mixpanel/streams/engage.py               88      6    93%
source_mixpanel/source.py                       79      8    90%
source_mixpanel/streams/annotations.py          16      3    81%
source_mixpanel/streams/cohort_members.py       21      7    67%
source_mixpanel/testing.py                      29     11    62%
----------------------------------------------------------------
TOTAL                                          518     41    92%

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:100: The previous and actual specifications are identical.
================== 41 passed, 1 skipped in 7803.28s (2:10:03) ==================

@archangelic
Copy link
Contributor

archangelic commented Apr 14, 2023

/test connector=connectors/source-mixpanel

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

Name                                         Stmts   Miss  Cover
----------------------------------------------------------------
source_mixpanel/utils.py                         8      0   100%
source_mixpanel/streams/revenue.py              14      0   100%
source_mixpanel/streams/funnels.py              57      0   100%
source_mixpanel/streams/cohorts.py              15      0   100%
source_mixpanel/streams/__init__.py              9      0   100%
source_mixpanel/property_transformation.py      19      0   100%
source_mixpanel/__init__.py                      2      0   100%
source_mixpanel/streams/base.py                 93      3    97%
source_mixpanel/streams/export.py               68      3    96%
source_mixpanel/streams/engage.py               88      6    93%
source_mixpanel/source.py                       79      8    90%
source_mixpanel/streams/annotations.py          16      3    81%
source_mixpanel/streams/cohort_members.py       21      7    67%
source_mixpanel/testing.py                      29     11    62%
----------------------------------------------------------------
TOTAL                                          518     41    92%

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:100: The previous and actual specifications are identical.
================= 41 passed, 1 skipped in 13508.35s (3:45:08) ==================

Copy link
Collaborator

@lazebnyi lazebnyi left a comment

Choose a reason for hiding this comment

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

LGTM!

@marcosmarxm
Copy link
Member

Waiting CI get green again.

@marcosmarxm marcosmarxm removed their assignment May 12, 2023
@jeremySrgt
Copy link
Contributor Author

Waiting CI get green again.

@marcosmarxm Do i need to do somethings about it on my side ?

@marcosmarxm
Copy link
Member

@jeremySrgt nope waiting our team to fix CI and run merge your contribution.

@marcosmarxm
Copy link
Member

marcosmarxm commented May 15, 2023

/publish connector=connectors/source-mixpanel

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


Connector Version Did it publish? Were definitions generated?
connectors/source-mixpanel 0.1.34

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

@marcosmarxm
Copy link
Member

marcosmarxm commented May 23, 2023

/test connector=connectors/source-mixpanel

🕑 connectors/source-mixpanel https://github.com/airbytehq/airbyte/actions/runs/5061279988

@marcosmarxm
Copy link
Member

The CI continue to fail for Mixpanel connect. Waiting the fix to merge this contribution.

@marcosmarxm
Copy link
Member

marcosmarxm commented Jun 5, 2023

/test connector=connectors/source-mixpanel

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

Name                                         Stmts   Miss  Cover
----------------------------------------------------------------
source_mixpanel/utils.py                         8      0   100%
source_mixpanel/streams/revenue.py              14      0   100%
source_mixpanel/streams/funnels.py              57      0   100%
source_mixpanel/streams/cohorts.py              15      0   100%
source_mixpanel/streams/__init__.py              9      0   100%
source_mixpanel/property_transformation.py      19      0   100%
source_mixpanel/__init__.py                      2      0   100%
source_mixpanel/streams/base.py                 90      3    97%
source_mixpanel/streams/export.py               76      5    93%
source_mixpanel/streams/engage.py               88      6    93%
source_mixpanel/source.py                       79      8    90%
source_mixpanel/streams/annotations.py          16      3    81%
source_mixpanel/streams/cohort_members.py       21      7    67%
source_mixpanel/testing.py                      29     11    62%
----------------------------------------------------------------
TOTAL                                          523     43    92%

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:100: The previous and actual specifications are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:598: The previous and actual discovered catalogs are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
================== 40 passed, 3 skipped in 7803.53s (2:10:03) ==================

@marcosmarxm marcosmarxm merged commit d369fd9 into airbytehq:master Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants