Skip to content

Minor: reuse test schemas in simplify tests - #17864

Merged
alamb merged 1 commit into
apache:mainfrom
alamb:alamb/reuse_schema
Oct 2, 2025
Merged

Minor: reuse test schemas in simplify tests#17864
alamb merged 1 commit into
apache:mainfrom
alamb:alamb/reuse_schema

Conversation

@alamb

@alambalamb commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

While reviewing #17835 I noticed the same schema was being made many times in the tests. While we probably can't notice a difference in performance, it would be nice to avoid this

What changes are included in this PR?

Reuse the same DFSchemaRef for the tests

Are these changes tested?

By CI

Are there any user-facing changes?

@github-actionsgithub-actionsBot added the optimizer Optimizer rules label Oct 1, 2025
])
.to_dfschema_ref()
.unwrap()
static TEST_SCHEMA: LazyLock<DFSchemaRef> = LazyLock::new(|| {

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This just uses a static LazyLock to avoid recreating the same schemas over and over again

@compheadcomphead left a comment

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.

Thanks @alamb !

@alamb
alamb added this pull request to the merge queueOct 2, 2025
@alamb

alamb commented Oct 2, 2025

Copy link
Copy Markdown
ContributorAuthor

Thanks @comphead and @martin-g

Merged via the queue into apache:main with commit 1ac8186Oct 2, 2025
28 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizerOptimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@alamb@martin-g@comphead