Skip to content

Conversation

ararslan
Copy link
Contributor

@ararslan ararslan commented Mar 1, 2025

The internal Flatbuf module defines a function called Type. On Julia 1.12, defining a new function by defining methods is insufficient to distinguish it from defining new constructor methods for a visible type of the same name. It's now necessary to forward-declare the function to ensure it takes precedence over the other visible binding. Without doing so, Base.Type is extended in Flatbuf instead.

On current main with Julia v1.13.0-DEV.122:

julia> using Arrow
Info Given Arrow was explicitly requested, output will be shown live
WARNING: Constructor for type "Type" was extended in `Flatbuf` without explicit qualification or import.
  NOTE: Assumed "Type" refers to `Base.Type`. This behavior is deprecated and may differ in future versions.
  NOTE: This behavior may have differed in Julia versions prior to 1.12.
  Hint: If you intended to create a new generic function of the same name, use `function Type end`.
  Hint: To silence the warning, qualify `Type` as `Base.Type` in the method signature or explicitly `import Base: Type`.
Precompiling Arrow finished.
  1 dependency successfully precompiled in 4 seconds. 47 already precompiled.
  1 dependency had output during precompilation:
┌ Arrow
│  [Output was shown above]
└

julia> methods(Type)
# 2 methods for type constructor:
 [1] Type(b::UInt8)
     @ Arrow.Flatbuf ~/Projects/julia-packages/arrow-julia/src/metadata/Schema.jl:489
 [2] Type(::Type{T}) where T
     @ Arrow.Flatbuf ~/Projects/julia-packages/arrow-julia/src/metadata/Schema.jl:519

julia> Arrow.Flatbuf.Type === Type
[ Warning: Type is defined in Core and is not public in Arrow.Flatbuf
true

With this PR, the output is the same because of JuliaLang/julia#57546 but will have the correct behavior once that issue is fixed.

Fixes #555

@ericphanson ericphanson closed this Apr 4, 2025
@ericphanson ericphanson reopened this Apr 4, 2025
@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.96%. Comparing base (3712291) to head (9eb80c1).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #543      +/-   ##
==========================================
- Coverage   87.43%   86.96%   -0.48%     
==========================================
  Files          26       27       +1     
  Lines        3288     3398     +110     
==========================================
+ Hits         2875     2955      +80     
- Misses        413      443      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ufechner7
Copy link

Same problem on Julia 1.12-beta3

@kou
Copy link
Member

kou commented Aug 19, 2025

Could you rebase on main to re-run CI?

@ararslan ararslan force-pushed the aa/no-extend-base-type branch from ee4da1c to c7b40c4 Compare August 21, 2025 06:12
@ararslan
Copy link
Contributor Author

@kou, I've rebased.

@kou
Copy link
Member

kou commented Aug 21, 2025

Hmm... CI isn't executed... Could you re-rebase...?

For some reason, the internal Flatbuf module defines a function called
`Type`. On Julia 1.12, defining a new function by defining methods is
insufficient to distinguish it from defining new constructor methods for
a visible type of the same name. It's now necessary to forward-declare
the function to ensure it takes precedence over the other visible
binding. Without doing so, `Base.Type` is extended in Flatbuf instead.
@ararslan ararslan force-pushed the aa/no-extend-base-type branch from c7b40c4 to 9eb80c1 Compare August 21, 2025 22:01
@ararslan
Copy link
Contributor Author

Done, but I still don't see CI status. Is the repository configured such that CI is not run on PRs from forks?

@kou
Copy link
Member

kou commented Aug 22, 2025

Thanks. I can approve CI execution for "first-time contributor" now. I've approved now. Let's see the CI result with this change.

@ararslan
Copy link
Contributor Author

Looks like CI fails on Julia nightly with multiple threads, but not in a way that could plausibly be related to the changes here, so I think we're okay.

@kou
Copy link
Member

kou commented Aug 25, 2025

@quinnj @ericphanson @baumgold Can we merge this?

@kou
Copy link
Member

kou commented Sep 8, 2025

@quinnj @ericphanson @baumgold I'll merge this in the next week if nobody objects it.

@palday
Copy link
Contributor

palday commented Sep 18, 2025

@kou please merge since 1.12 is now RC2 ❤️

@kou kou merged commit c75d0e9 into apache:main Sep 19, 2025
84 of 88 checks passed
@kou
Copy link
Member

kou commented Sep 19, 2025

Merged. Should we release a new version before Julia 1.12 release?

@palday
Copy link
Contributor

palday commented Sep 19, 2025

@kou yes!

@kou kou mentioned this pull request Sep 19, 2025
@kou
Copy link
Member

kou commented Sep 19, 2025

OK. Let's discuss it in #567.

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.

Warnings on Julia 1.12-beta3
6 participants