[go: nahoru, domu]

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

bulk-cdk-core-base: InputState validation tweaks #44827

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

postamar
Copy link
Contributor

What

Context: https://airbytehq-team.slack.com/archives/C043JHEEYKG/p1724697591711879

It turns out that {} is expected to be a valid input for the --state CLI argument, same as []. This PR makes this possible; presently the InputStateFactory validation method throws a ConfigErrorException.

How

Ignore input objects where the type field is not set. Perform stricter validation when it is set.

Review guide

User Impact

Manually editing the input state to {} is now possible for any source connectors built using the Bulk CDK.

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

@postamar postamar requested review from a team as code owners August 27, 2024 17:36
Copy link
vercel bot commented Aug 27, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Aug 27, 2024 5:36pm

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Aug 27, 2024
@@ -35,6 +35,8 @@ class InputStateFactory {
): InputState {
val list: List<AirbyteStateMessage> =
ValidatedJsonUtils.parseList(AirbyteStateMessage::class.java, json ?: "[]")
// Discard states messages with unset type to allow {} as a valid input state.
.filter { it.type != null }
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

@postamar postamar merged commit 66b4921 into master Aug 27, 2024
33 checks passed
@postamar postamar deleted the postamar/relax-input-state-validation branch August 27, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants