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: Fix schemas and UI issues #8256

Merged
merged 7 commits into from
Nov 29, 2021

Conversation

lazebnyi
Copy link
Collaborator

@lazebnyi lazebnyi commented Nov 25, 2021

What

#8062 - Source Mixpanel: failed during normalization

Shortly about the problem.
Mixpanel 'engage' stream has a dynamic schema. There are some 'standard' fields but users can create custom fields as well.
I have tried to create such 'custom' fields but there is no way to specify the type for such custom fields. I tried to create fields with different values: ABC or 1. Such attrs are reported as a string for me. I was not able to find any way to change this.
The customer has a problem with the 'browser_version' field, which is a 'standard' field. It is reported as:
'number' - for customer
'string' - for our account.
The customer and I have similar values in this field, like "86.3.112.2", which is definitely a string.
So it is not clear what to do in this situation.

How

  • Normalization fix:
    For engage stream already fixed bug here PR, need refresh schemas on the cloud. For cohort_members stream hard-code types for known 'standard' fields, but rely on API for other 'custom' fields. Also was enabled DefaultSchemaNormalization for engage and cohort_members streams.

  • UI fix:
    Fixed schema anyOf construction issue for export and funnel streams. Added titles and deleted date_window_size from spec.json according to UX handbook.

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
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory 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

@lazebnyi lazebnyi linked an issue Nov 25, 2021 that may be closed by this pull request
@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Nov 25, 2021
@lazebnyi lazebnyi temporarily deployed to more-secrets November 25, 2021 16:27 Inactive
@lazebnyi lazebnyi changed the title 🐛 Source Mixpanel: Fix schemas and ui issues 🐛 Source Mixpanel: Fix schemas and UI issues Nov 25, 2021
@lazebnyi
Copy link
Collaborator Author

lazebnyi commented Nov 25, 2021

/test connector=connectors/source-mixpanel

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

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        75      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       38     27    29%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 62     25    60%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  896    440    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                          Stmts   Miss  Cover
	 -------------------------------------------------
	 source_mixpanel/__init__.py       2      0   100%
	 source_mixpanel/source.py       294    176    40%
	 -------------------------------------------------
	 TOTAL                           296    176    41%

@jrhizor jrhizor temporarily deployed to more-secrets November 25, 2021 16:37 Inactive
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

@lazebnyi how does this fix the normalization issue?

@lazebnyi
Copy link
Collaborator Author

lazebnyi commented Nov 25, 2021

@sherifnada As I said in the status, unfortunately, I could not reproduce the issue with normalization.

In the contributor's log, I found this row:

�[32mnormalization�[0m - 2021-11-16 23:36:30 INFO LineGobbler(voidCall):82 - 23:36:30 + "AIRBYTE_DATABASE".AIRBYTE_SCHEMA."MIXPANEL_ENGAGE"._AIRBYTE_AB_ID does not exist. The table needs to be rebuilt in full_refresh
�[32mnormalization�[0m - 2021-11-16 23:36:30 INFO LineGobbler(voidCall):82 - 23:36:30 + "AIRBYTE_DATABASE".AIRBYTE_SCHEMA."MIXPANEL_COHORT_MEMBERS"._AIRBYTE_AB_ID does not exist. The table needs to be rebuilt in full_refresh

I think the problem is with destination tables and data types there. Maybe changes were made manually by the contributor.

@lazebnyi lazebnyi temporarily deployed to more-secrets November 26, 2021 12:19 Inactive
@lazebnyi lazebnyi temporarily deployed to more-secrets November 29, 2021 10:16 Inactive
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

LGTM - can you add an explanation in the PR description of why this fixes the problem for historical context based on our slack convo?

@lazebnyi
Copy link
Collaborator Author

lazebnyi commented Nov 29, 2021

/test connector=connectors/source-mixpanel

🕑 connectors/source-mixpanel https://github.com/airbytehq/airbyte/actions/runs/1515964946
❌ connectors/source-mixpanel https://github.com/airbytehq/airbyte/actions/runs/1515964946
🐛 https://gradle.com/s/ebzazdftx5isc

@jrhizor jrhizor temporarily deployed to more-secrets November 29, 2021 12:43 Inactive
@lazebnyi lazebnyi marked this pull request as ready for review November 29, 2021 12:46
@lazebnyi lazebnyi temporarily deployed to more-secrets November 29, 2021 13:23 Inactive
@lazebnyi
Copy link
Collaborator Author

lazebnyi commented Nov 29, 2021

/test connector=connectors/source-mixpanel

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

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        75      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       38     27    29%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 62     25    60%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  896    440    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                          Stmts   Miss  Cover
	 -------------------------------------------------
	 source_mixpanel/__init__.py       2      0   100%
	 source_mixpanel/source.py       296    176    41%
	 -------------------------------------------------
	 TOTAL                           298    176    41%

@jrhizor jrhizor temporarily deployed to more-secrets November 29, 2021 13:26 Inactive
@lazebnyi
Copy link
Collaborator Author

lazebnyi commented Nov 29, 2021

/publish connector=connectors/source-mixpanel

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

@jrhizor jrhizor temporarily deployed to more-secrets November 29, 2021 16:45 Inactive
@lazebnyi lazebnyi merged commit 9428b40 into master Nov 29, 2021
@lazebnyi lazebnyi deleted the lazebnyi/8062-fix-schemas-and-ui-issues branch November 29, 2021 17:33
@lazebnyi lazebnyi temporarily deployed to more-secrets November 29, 2021 17:34 Inactive
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
* Fixed schemas and ui issues

* Deleted anyOf structure from schema

* Updated PR number

* Added fields with static data types to cohort_members schema

* Add DefaultSchemaNormalization to Engage and CohortMembers streams

* Changed Transformer name

* Checkin specs
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source Mixpanel: failed during normalization
4 participants