Skip to content

🐛 Source MySQL: transform binary data base64 format - #8047

Merged
mkhokh-33 merged 6 commits into
masterfrom
mkhokh/5878-binary-data-mysql-source
Nov 23, 2021
Merged

🐛 Source MySQL: transform binary data base64 format#8047
mkhokh-33 merged 6 commits into
masterfrom
mkhokh/5878-binary-data-mysql-source

Conversation

@mkhokh-33

@mkhokh-33 mkhokh-33 commented Nov 17, 2021

Copy link
Copy Markdown
Contributor

What

MySql source handle binary data as base64 encoded string, fixed integrations data type tests
Fixed cdc handling of binary data as base64 encoded string and cdc integrations data type
Provide additional properties in JSON schema for binary data
Added tests to check how BinaryNode will be serialized

How

Configured MySqlCdcProperties with binary.handling.mode = base64 to make sure that binary data represented as a base64-encoded String

Recommended reading order

  1. x.java
  2. y.json
  3. y.md

🚨 User Impact 🚨

For AirbyteStream in jsonShema will appear new additional property contentEncoding:
jsonSchema={"type":"object","properties":{"name":{"type":"string","contentEncoding":"base64"},"id":{"type":"string"}}}
as far as I see - https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/bases/base-normalization/normalization/transform_catalog/stream_processor.py#L483
it should not affect how binary data will be represented in destination with normalization

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
  • 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 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
  • 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

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.

@CLAassistant

CLAassistant commented Nov 17, 2021

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added area/connectors Connector related issues area/platform issues related to the platform area/protocol labels Nov 17, 2021
@mkhokh-33
mkhokh-33 temporarily deployed to more-secrets November 17, 2021 11:27 Inactive
@mkhokh-33 mkhokh-33 changed the title Source-MySql: transform binary data base64 format, add integration tests 🐛 Source MySQL: transform binary data base64 format Nov 17, 2021
@mkhokh-33

mkhokh-33 commented Nov 17, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/source-mysql

🕑 connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/1471358695
✅ connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/1471358695
No Python unittests run

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 17, 2021 11:36 Inactive
@mkhokh-33
mkhokh-33 temporarily deployed to more-secrets November 17, 2021 11:57 Inactive
@mkhokh-33
mkhokh-33 temporarily deployed to more-secrets November 17, 2021 13:33 Inactive
@mkhokh-33
mkhokh-33 temporarily deployed to more-secrets November 17, 2021 14:05 Inactive
@mkhokh-33 mkhokh-33 linked an issue Nov 17, 2021 that may be closed by this pull request
BOOLEAN,
NULL;

STRING_BINARY(ImmutableMap.of("type", "string", "contentEncoding", "base64")),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Liren Tu (@tuliren) can we use JsonSchemaPrimitive as is in scope of this PR or better wait until #7944 will be implemented?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, I think the current implementation looks good.

@mkhokh-33
mkhokh-33 marked this pull request as ready for review November 19, 2021 09:51
@mkhokh-33

mkhokh-33 commented Nov 19, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/source-mysql-strict-encrypt

🕑 connectors/source-mysql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1480466761
✅ connectors/source-mysql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1480466761
No Python unittests run

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 19, 2021 10:01 Inactive
@github-actions github-actions Bot added the area/documentation Improvements or additions to documentation label Nov 19, 2021
@mkhokh-33
mkhokh-33 temporarily deployed to more-secrets November 19, 2021 10:15 Inactive
@mkhokh-33

mkhokh-33 commented Nov 19, 2021

Copy link
Copy Markdown
Contributor Author

/publish connector=connectors/source-mysql

🕑 connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/1480592021
✅ connectors/source-mysql https://github.com/airbytehq/airbyte/actions/runs/1480592021

@mkhokh-33

mkhokh-33 commented Nov 19, 2021

Copy link
Copy Markdown
Contributor Author

/publish connector=connectors/source-mysql-strict-encrypt

🕑 connectors/source-mysql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1480593657
✅ connectors/source-mysql-strict-encrypt https://github.com/airbytehq/airbyte/actions/runs/1480593657

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 19, 2021 10:36 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 19, 2021 12:42 Inactive
@mkhokh-33

mkhokh-33 commented Nov 19, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/source-postgres

🕑 connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/1481475756
✅ connectors/source-postgres https://github.com/airbytehq/airbyte/actions/runs/1481475756
No Python unittests run

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 19, 2021 14:52 Inactive
@mkhokh-33

mkhokh-33 commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-mysql

🕑 connectors/destination-mysql https://github.com/airbytehq/airbyte/actions/runs/1490443738
✅ connectors/destination-mysql https://github.com/airbytehq/airbyte/actions/runs/1490443738
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    12      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     120      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 11      0   100%
	 normalization/transform_catalog/stream_processor.py                 468    287    39%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         140     29    79%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1160    472    59%

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 22, 2021 13:44 Inactive
@mkhokh-33

mkhokh-33 commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-mssql

🕑 connectors/destination-mssql https://github.com/airbytehq/airbyte/actions/runs/1490572686
✅ connectors/destination-mssql https://github.com/airbytehq/airbyte/actions/runs/1490572686
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    12      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     120      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 11      0   100%
	 normalization/transform_catalog/stream_processor.py                 468    287    39%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         140     29    79%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1160    472    59%

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 22, 2021 14:15 Inactive
@mkhokh-33
mkhokh-33 temporarily deployed to more-secrets November 22, 2021 17:56 Inactive
@mkhokh-33
mkhokh-33 temporarily deployed to more-secrets November 22, 2021 19:03 Inactive
@mkhokh-33
mkhokh-33 temporarily deployed to more-secrets November 22, 2021 19:17 Inactive
@mkhokh-33

mkhokh-33 commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-mysql

🕑 connectors/destination-mysql https://github.com/airbytehq/airbyte/actions/runs/1491866210
✅ connectors/destination-mysql https://github.com/airbytehq/airbyte/actions/runs/1491866210
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    12      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     120      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 11      0   100%
	 normalization/transform_catalog/stream_processor.py                 468    287    39%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         140     29    79%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1160    472    59%

@mkhokh-33

mkhokh-33 commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-mssql

🕑 connectors/destination-mssql https://github.com/airbytehq/airbyte/actions/runs/1491867113
✅ connectors/destination-mssql https://github.com/airbytehq/airbyte/actions/runs/1491867113
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    12      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     120      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 11      0   100%
	 normalization/transform_catalog/stream_processor.py                 468    287    39%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         140     29    79%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1160    472    59%

@mkhokh-33

mkhokh-33 commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-postgres

🕑 connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/1491871899
✅ connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/1491871899
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    12      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     120      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 11      0   100%
	 normalization/transform_catalog/stream_processor.py                 468    287    39%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         140     29    79%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1160    472    59%

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 22, 2021 19:51 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 22, 2021 19:51 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 22, 2021 19:53 Inactive
@mkhokh-33

mkhokh-33 commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-oracle

🕑 connectors/destination-oracle https://github.com/airbytehq/airbyte/actions/runs/1491878254
✅ connectors/destination-oracle https://github.com/airbytehq/airbyte/actions/runs/1491878254
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    12      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     120      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 11      0   100%
	 normalization/transform_catalog/stream_processor.py                 468    287    39%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         140     29    79%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1160    472    59%

@mkhokh-33

mkhokh-33 commented Nov 22, 2021

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1491880204
✅ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1491880204
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    12      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     120      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 11      0   100%
	 normalization/transform_catalog/stream_processor.py                 468    287    39%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         140     29    79%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1160    472    59%

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 22, 2021 19:55 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets November 22, 2021 19:55 Inactive
@mkhokh-33
mkhokh-33 merged commit 5032add into master Nov 23, 2021
@mkhokh-33
mkhokh-33 deleted the mkhokh/5878-binary-data-mysql-source branch November 23, 2021 14:04
Konrad Schlatte (schlattk) pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
* Source-MySql: transform binary data base64 format, add integration tests

* Source-MySql: fix code style

* Source-MySql: bump versions

* Source-MySql: bump versions in source_specs.yaml

* Source-MySql: added test for stream with binary data for DestinationAbstractTest

* Source-MySql: added format
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.

MySql source : source binary node transforms to text node

8 participants