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 Export HTTP Response Parsing #11318

Conversation

guillaume-chech
Copy link
Contributor

@guillaume-chech guillaume-chech commented Mar 22, 2022

Testing!!!## What
Export stream processing could fail in some edge cases where individual Export text properties would contains line breaks causing the json parser to fail. As reported here #11018

How

The solution replaces the usage of response.text.splitlines() by the use of the HTTP response response.iter_lines() method. No other changes implemented.

Recommended reading order

  1. source_mixpanel/souce.py

🚨 User Impact 🚨

No impact expected. Change should be transparent.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

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/SUMMARY.md
    • 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 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
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
Results (0.20s):
       1 passed
Integration
Test session starts (platform: darwin, Python 3.8.2, pytest 6.2.5, pytest-sugar 0.9.4)
cachedir: .pytest_cache
rootdir: /Users/guillaume/Shotgun/airbyte, configfile: pytest.ini
plugins: sugar-0.9.4, timeout-1.4.2
collecting ... 

Results (0.01s):
Acceptance

I did not manage to run those likely that something is wrong with my setup.

@CLAassistant
Copy link

CLAassistant commented Mar 22, 2022

CLA assistant check
All committers have signed the CLA.

@marcosmarxm
Copy link
Member

Can you sign the CLA @guillaume-chech ? Also can you share the integration tests or a screenshoot showing the modification solves the issue?

@marcosmarxm
Copy link
Member

Overall the change looks great thanks @guillaume-chech

@marcosmarxm marcosmarxm self-assigned this Mar 23, 2022
@guillaume-chech
Copy link
Contributor Author

guillaume-chech commented Mar 23, 2022

Sorry about the acceptance test not being implemented, I'm a bit short on time and my pyhton skills are a bit rusty so i'll go for the good old with or without run "proof"

Sure here is a proof of the fix working ,I ran this command to test on a faulty day of data :
python3 main.py read --config secrets/config.json --catalog integration_tests/configured_catalog_export.json
Screenshot 2022-03-23 at 16 32 41

Screenshot 2022-03-23 at 16 30 01

And without the fix :
Screenshot 2022-03-23 at 16 34 38

@marcosmarxm
Copy link
Member

marcosmarxm commented Mar 23, 2022

/test connector=connectors/source-mixpanel repo=guillaume-chech/airbyte

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

@guillaume-chech
Copy link
Contributor Author

@marcosmarxm Looks like something went wrong with the acceptance test run. Do you have more logs of the run, it's just saying that the instance was killed :)

@marcosmarxm
Copy link
Member

Our Mixpanel CI is broke @guillaume-chech I'm working to fix it and run tests with your changes

…ub.com:guillaume-chech/airbyte into marcos/test-pr-11318
@marcosmarxm
Copy link
Member

Our Mixpanel CI is broke @guillaume-chech I'm working to fix it and run tests with your changes

@guillaume-chech I'm working to remove data from our integration accoun, hope tomorrow I can test your changes and merged it.

@guillaume-chech
Copy link
Contributor Author

@marcosmarxm Did you manage to implement a fix for the CI ?

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Apr 4, 2022
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants