Skip to content

🚨✨ Source Convex - switch the JSON format requested from Convex#30853

Merged
Marcos Marx (marcosmarxm) merged 9 commits intoairbytehq:masterfrom
nipunn1313:nipunn/formatting
Nov 29, 2023
Merged

🚨✨ Source Convex - switch the JSON format requested from Convex#30853
Marcos Marx (marcosmarxm) merged 9 commits intoairbytehq:masterfrom
nipunn1313:nipunn/formatting

Conversation

@nipunn1313
Copy link
Copy Markdown
Contributor

What

We're updating the json format which is requested from the backend from convex_json to json. The new format is more readable/usable (rather than prioritizing roundtrippable).

How

Updating the source connector to request json format (rather than convex_json format). The format is a tad simpler and cleaner in how it handles a few cases.

Added a fmt parameter to the configuration structure, defaulting it to json format. Intentionally left it out of the yml.

We updated the airbyte-client version number which we send up as a header so the server can detect the new version.

Recommended reading order

  1. There are two commits. First commit updates formatting / fixes mypy. No behavior change.
  2. Second commit: source.py - Updates json format
  3. Second commit: unit tests

🚨 User Impact 🚨

The users will see a simpler JSON format which encodes a few values a bit differently. Most exports will not see a difference.
Examples:
Bigints go from {"$integer": "55"} to "55"
Infinite floats go from {"$float": "Inf"} to {"Inf"}
... a few more cases

Pre-merge Actions

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Unit & integration tests added

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.

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2023 2:46pm

@github-actions
Copy link
Copy Markdown
Contributor

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

Add fmt param to the source-convex connector for future extensibility.
May add it to the configuration options in the future, but for now, just
have it there for testability, defaulting to json format.
@nipunn1313 Nipunn Koorapati (nipunn1313) changed the title 🚨✨ source-convex: Convex source - switch the JSON format requested from Convex 🚨✨ Source Convex - switch the JSON format requested from Convex Sep 28, 2023
@nipunn1313
Copy link
Copy Markdown
Contributor Author

Hi. I am blocked on this - in order to make sure all the tests and formatting pass CI.
image

Copy link
Copy Markdown
Contributor

@marcosmarxm Marcos Marx (marcosmarxm) left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution Nipunn Koorapati (@nipunn1313) and sorry the missing update here.
This introduces a breaking change to existing connectors? If someone update the message read by Airbyte will be different?
Convex is deprecating the convex_json or you're introducing only another supported type?
If the first, what is the ETA to remove it?

Can you remove the parse_config function? The UI already apply this validation and it's duplicating features here.
If you have only a format type you as a constant in the code, if users can select the format type, which I don't believe it brings any performance to them add the option in the spec.json/yaml file.

@nipunn1313
Copy link
Copy Markdown
Contributor Author

Nipunn Koorapati (nipunn1313) commented Oct 11, 2023

This introduces a breaking change to existing connectors?

Yes... sort of. It (subtly/minorly) simplifies the JSON format for subsequent documents.

Fortunately, we have stats on our side (from the server API endpoints) on who is using the airbyte connector with convex and it is only one customer - whom we are directly in contact with. They are ok with this change.

If someone update the message read by Airbyte will be different? Convex is deprecating the convex_json or you're introducing only another supported type?

There is only one documented type json. https://docs.convex.dev/database/types
The backend will continue to support the old convex_json format indefinitely, but it is not documented. This PR is switching to the documented format. Again, we only have one customer using airbyte with whom we are in close contact with.

Can you remove the parse_config function? The UI already apply this validation and it's duplicating features here. If you have only a format type you as a constant in the code, if users can select the format type, which I don't believe it brings any performance to them add the option in the spec.json/yaml file.

Yes - I can do that.

@nipunn1313
Copy link
Copy Markdown
Contributor Author

Hello. I've removed parse_config and wanted to check in here.

@nipunn1313
Copy link
Copy Markdown
Contributor Author

Hello. I wanted to check in here again.

@marcosmarxm
Copy link
Copy Markdown
Contributor

Nipunn Koorapati (@nipunn1313) at the moment the team is dedicated reviewing Hackathon contribution. We're going to return to the community backlog in the future.

@nipunn1313
Copy link
Copy Markdown
Contributor Author

Hello. Wanted to check in here. I understand your team has been busy recently.

What expectations should I have around the timing of this review? (IE - when should I check in again?).

@nataliekwong
Copy link
Copy Markdown
Contributor

Hey Nipunn Koorapati (@nipunn1313) , I apologize for the delay here. This is certainly not the experience we want you to have when contributing. Your PR, among others, sparked conversations internally about how we can improve the speed of PR review for those contributing their own company's connectors.

Kat Wilson (@katmarkham) is our steward of API sources here, and is working with her team to set a process to fast-track these in the future. For this particular PR, the team is hoping to start review by the end of next week as other projects are getting shuffled.

Copy link
Copy Markdown
Contributor

@lazebnyi Serhii 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.

Approved with condition. The braking changes process must be followed.

deployment_url = config["deployment_url"]
access_key = config["access_key"]
url = f"{deployment_url}/api/json_schemas?deltaSchema=true&format=convex_json"
url = f"{deployment_url}/api/json_schemas?deltaSchema=true&format=json"
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.

Look like braking changes as schema will be updated.

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.

Approved with condition. The braking changes process must be followed.

@nataliekwong
Copy link
Copy Markdown
Contributor

Serhii Lazebnyi (@lazebnyi) In the comments, it's noted there is only 1 user of the connector and they are already aware of this change as the contributor is already in close contact with the user. While it is a schema change, I recommend not requiring the breaking change process given we can simply inform the user of the connector of the change. Kat Wilson (@katmarkham)

@nipunn1313
Copy link
Copy Markdown
Contributor Author

While it is a schema change, I recommend not requiring the breaking change process given we can simply inform the user of the connector of the change.

Yep! That sounds good to us.

Copy link
Copy Markdown
Contributor

@marcosmarxm Marcos Marx (marcosmarxm) left a comment

Choose a reason for hiding this comment

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

Releasing without breaking change as Natalie Kwong (@nataliekwong) commented.

@marcosmarxm
Copy link
Copy Markdown
Contributor

Nipunn Koorapati (@nipunn1313) thanks for the contribution. Waiting the master branch allow to merge your contribution :)

@marcosmarxm Marcos Marx (marcosmarxm) merged commit eb25eac into airbytehq:master Nov 29, 2023
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 connectors/source/convex

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

5 participants