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

Error message for invalid preload argument incorrectly states that only arity 1 functions are supported #4554

Closed
stiang opened this issue Dec 2, 2024 · 0 comments
Labels

Comments

@stiang
Copy link

stiang commented Dec 2, 2024

Elixir version

1.15.5

Database and Version

PostgreSQL 16.1

Ecto Versions

3.12.5

Database Adapter and Versions (postgrex, myxql, etc)

postgrex 0.19.3

Current behavior

I’m trying to use arity 2 preload functions, and in the process I have inadvertently supplied invalid values for the preload keyword several times, which threw the following error:

** (ArgumentError) invalid preload for key `:enabled_partner_features`: &ApiServer.V1.Partners.enabled_partner_features/2. Preloads can be a query, a function (arity 1), or a dynamic that evaluates to a single binding.

This comes from assert_query_or_fun!/2 in lib/ecto/query/builder/preload.ex.

Expected behavior

Arity 2 functions are supported since 3.12 (I believe), so I think the error message just needs to be updated to reflect that fact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant