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

Destination S3V2: Fix: Avro names starting with numbers #50403

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

johnny-schmidt
Copy link
Contributor

What

Fix copy-pasted from the original code.

Not in the ideal place, but I think we need a discrete mapper / stage for stream/namespace mangling as part of our types roundup, so parking it here for now

@johnny-schmidt johnny-schmidt requested a review from a team as a code owner December 23, 2024 19:36
Copy link

vercel bot commented Dec 23, 2024

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 Dec 23, 2024 7:41pm

fun toAvroSafeName(name: String) = toAlphanumericAndUnderscore(name)
fun toAvroSafeName(name: String): String {
val stripped = toAlphanumericAndUnderscore(name)
return if (stripped.substring(0, 1).matches("[A-Za-z_]".toRegex())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe more clear

val firstChar = stripped[0]
return if (firstChar.isLetterOrDigit() || firstChar == '_')

@johnny-schmidt johnny-schmidt merged commit a99bc69 into master Dec 23, 2024
26 checks passed
@johnny-schmidt johnny-schmidt deleted the jschmidt/s3v2/missing-avro-name-namngling branch December 23, 2024 22:26
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.

3 participants