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

dekaf: Fix endpoint config parsing #1841

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

jshearer
Copy link
Contributor

@jshearer jshearer commented Dec 18, 2024

This got left out of #1793 and is needed for Dekaf materialization endpoints


This change is Reviewable

This got left out of #1793 and is needed for Dekaf materialization endpoints
@jshearer jshearer requested a review from psFried December 18, 2024 19:30
Copy link
Member

@psFried psFried left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -70,8 +71,22 @@ pub async fn unary_materialize(
) -> anyhow::Result<materialize::Response> {
use proto_flow::materialize::response::validated;
if let Some(mut validate) = request.validate {
serde_json::de::from_str::<DekafConfig>(&validate.config_json)
.context("validating endpoint config")?;
match materialization_spec::ConnectorType::try_from(validate.connector_type)? {
Copy link
Member

Choose a reason for hiding this comment

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

Just as an fyi, you could also use

let ConnectorType::Dekaf = ConnectorType::try_from(validate.connector_type)? else {
  bail!("...");
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But then I wouldn't have the parsed proto_flow::flow::materialization_spec::ConnectorType, which can give me a human-readableas_str_name() instead of just proto_flow::materialize::request::Validate:: connector_type: i32, which is much less useful in an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants