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 mongoDB: implement building JsonSchema with 'properties' for fields with type 'object' #12428

Merged
merged 4 commits into from
May 5, 2022

Conversation

yurii-bidiuk
Copy link
Contributor

@yurii-bidiuk yurii-bidiuk commented Apr 28, 2022

What

Fixed #8586
On the source-mongodb-v2 implemented building JsonSchema with nested properties for fields with type "object"

How

Add recursive fetching of fields and types from mongo collection. Modified CommonField and Field classes to support subfields.

Recommended reading order

  1. MongoUtils.java
  2. MongoDBSource.java
  3. CatalogHelpers.java

🚨 User Impact 🚨

Users will be able to see on the UI all fields and types including all sublevels fields.

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

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@github-actions github-actions bot added area/connectors Connector related issues area/platform issues related to the platform area/protocol labels Apr 28, 2022
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets April 28, 2022 09:19 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets April 28, 2022 09:19 Inactive
@yurii-bidiuk yurii-bidiuk force-pushed the bidiuk/8586-bq-denormalized-fix-bug branch from 2291e8c to 5e18168 Compare April 28, 2022 09:27
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets April 28, 2022 09:29 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets April 28, 2022 09:29 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets April 29, 2022 12:53 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets April 29, 2022 12:53 Inactive
@yurii-bidiuk yurii-bidiuk changed the title [WIP]: Source mongoDB: implement building JsonSchema with 'properties' for fields with type 'object' 🎉🐛: Source mongoDB: implement building JsonSchema with 'properties' for fields with type 'object' Apr 29, 2022
Copy link
Contributor

@alexandr-shegeda alexandr-shegeda left a comment

Choose a reason for hiding this comment

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

LGTM

@alexandr-shegeda alexandr-shegeda marked this pull request as ready for review May 4, 2022 09:53
}

/**
* If one field has different types in 2 and more documents, the name is transofmed to
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo: transformed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@noahkawasaki-airbyte noahkawasaki-airbyte left a comment

Choose a reason for hiding this comment

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

LGTM too, did you run tests in CI? I dont see them having run from "Sonar Scan / Tests for ${{ matrix.module }} (pull_request)". Also are you going to bump version in this PR or do you usually do a follow up?

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented May 5, 2022

/test connector=connectors/source-mongodb-v2

🕑 connectors/source-mongodb-v2 https://github.com/airbytehq/airbyte/actions/runs/2274232654
✅ connectors/source-mongodb-v2 https://github.com/airbytehq/airbyte/actions/runs/2274232654
No Python unittests run

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label May 5, 2022
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets May 5, 2022 08:10 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets May 5, 2022 08:10 Inactive
@yurii-bidiuk yurii-bidiuk force-pushed the bidiuk/8586-bq-denormalized-fix-bug branch from 2d821c6 to f73543d Compare May 5, 2022 08:19
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets May 5, 2022 08:21 Inactive
@yurii-bidiuk yurii-bidiuk temporarily deployed to more-secrets May 5, 2022 08:21 Inactive
@yurii-bidiuk
Copy link
Contributor Author

LGTM too, did you run tests in CI? I dont see them having run from "Sonar Scan / Tests for ${{ matrix.module }} (pull_request)". Also are you going to bump version in this PR or do you usually do a follow up?

@noahkawasaki-airbyte thanks for the review.
Tests are passed in CI and the version is bumped in the new commit. Going to publish

@yurii-bidiuk
Copy link
Contributor Author

yurii-bidiuk commented May 5, 2022

/publish connector=connectors/source-mongodb-v2

🕑 connectors/source-mongodb-v2 https://github.com/airbytehq/airbyte/actions/runs/2274685354
🚀 Successfully published connectors/source-mongodb-v2
🚀 Auto-bumped version for connectors/source-mongodb-v2
✅ connectors/source-mongodb-v2 https://github.com/airbytehq/airbyte/actions/runs/2274685354

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets May 5, 2022 09:14 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets May 5, 2022 09:14 Inactive
@yurii-bidiuk yurii-bidiuk merged commit b3194b2 into master May 5, 2022
@yurii-bidiuk yurii-bidiuk deleted the bidiuk/8586-bq-denormalized-fix-bug branch May 5, 2022 09:56
suhomud pushed a commit that referenced this pull request May 23, 2022
…or fields with type 'object' (#12428)

* mongodb: build JsonSchema with 'properties'

* add tests

* bump version

* auto-bump connector version

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
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 area/platform issues related to the platform area/protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Destination BigQuery denormalized (MongoDB source): JSON table encountered too many errors, giving up.
4 participants