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

refactor: use LazyLock in the user_doc macro #13684

Merged
merged 6 commits into from
Dec 8, 2024
Merged

Conversation

jonahgao
Copy link
Member

@jonahgao jonahgao commented Dec 7, 2024

Which issue does this PR close?

Part of #11687

Rationale for this change

Replace OnceLock with LazyLock.

What changes are included in this PR?

Are these changes tested?

Yes.
Run ./dev/update_function_docs.sh and verified that the documentation content didn't changed.

Are there any user-facing changes?

No

Some(#lock_name.get_or_init(|| {
Documentation::builder(DocSection { include: #doc_section_include, label: #doc_section_lbl, description: #doc_section_description },
fn doc(&self) -> Option<&datafusion_doc::Documentation> {
static DOCUMENTATION: std::sync::LazyLock<datafusion_doc::Documentation> =
Copy link
Contributor

Choose a reason for hiding this comment

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

thats interesting, I tried doing the same with OnceLock, to move it inside the doc method but it didn't work. Surprisingly it works with LazyLock

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

lgtm thanks @jonahgao

This PR will be conflicting with #13685

@jonahgao
Copy link
Member Author

jonahgao commented Dec 8, 2024

Conflicting resolved. Thanks @comphead for the review.

@jonahgao jonahgao merged commit 6c9355d into apache:main Dec 8, 2024
25 checks passed
@jonahgao jonahgao deleted the user_doc branch December 8, 2024 15:37
zhuliquan pushed a commit to zhuliquan/datafusion that referenced this pull request Dec 11, 2024
* refactor: use `LazyLock` in the `user_doc` macro

* Fix cargo doc

* Update datafusion/macros/src/lib.rs

* Fix doc comment

---------

Co-authored-by: Oleks V <[email protected]>
zhuliquan pushed a commit to zhuliquan/datafusion that referenced this pull request Dec 15, 2024
* refactor: use `LazyLock` in the `user_doc` macro

* Fix cargo doc

* Update datafusion/macros/src/lib.rs

* Fix doc comment

---------

Co-authored-by: Oleks V <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants