Skip to content

structpath: add NewPattern with AnyKey/AnyIndex wildcards - #7074

Closed
denik wants to merge 1 commit into
mainfrom
denik/structpath-new-pattern
Closed

denik wants to merge 1 commit into
mainfrom
denik/structpath-new-pattern

Conversation

@denik

@denik denik commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Changes

Add structpath.NewPattern(prev, parts...), the pattern counterpart of NewPath: strings are keys, ints are indices, and structpath.AnyKey / structpath.AnyIndex append .* / [*] wildcards.

structpath.NewPattern(nil, "artifacts", name, "files", structpath.AnyIndex, "source")

Why

The upcoming libs/dyn removal (#6954) builds patterns in many places. Without this, callers either nest single-step constructors or format and parse pattern strings, which breaks on user keys containing path syntax. Wildcards are sentinels rather than "*" strings so a user key named * can't become a wildcard.

Tests

Unit test in libs/structs/structpath.

This pull request and its description were written by Isaac.

NewPattern builds a pattern from parts like NewPath does for paths, so
callers don't nest the single-step constructors or parse pattern strings.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 6674d4b

Run: 38759292873

Env 🔄​flaky ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 276 15 5:45
✅​ aws-windows-latest-4core-16gb 278 13 3:46
✅​ azure linux-2core-8gb 275 15 5:29
🔄​ azure-windows-latest-4core-16gb 1 276 13 3:41
✅​ gcp linux-2core-8gb 276 15 5:43
✅​ gcp-windows-latest-4core-16gb 278 13 3:41
Test Name azure-windows-latest-4core-16gb
🔄​ TestSyncIncrementalFileOverwritesFolder 🔄​f
Top 6 slowest tests (at least 2 minutes):
duration env testname
3:48 azure linux-2core-8gb TestAccept
3:42 aws-windows-latest-4core-16gb TestAccept
3:41 gcp linux-2core-8gb TestAccept
3:34 aws linux-2core-8gb TestAccept
3:32 gcp-windows-latest-4core-16gb TestAccept
3:19 azure-windows-latest-4core-16gb TestAccept

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