elixir-ecto / ecto_sql

SQL-based adapters for Ecto and database migrations
https://hexdocs.pm/ecto_sql
Apache License 2.0
578 stars 312 forks source link

Using map.field notation (without parentheses) to invoke function is deprecated #625

Closed Jwashton closed 4 months ago

Jwashton commented 4 months ago

Elixir version

1.17.2

Database and Version

PostgreSQL 16.3

Ecto Versions

ecto 3.10.2, ecto_sql 3.10.1, phoenix_ecto 4.4.2

Database Adapter and Versions (postgrex, myxql, etc)

postgrex 0.17.1

Current behavior

When running a migration, I see these deprecation warnings. The migration otherwise runs as expected.

$ mix ecto.migrate
warning: using map.field notation (without parentheses) to invoke function AGSupport.Repo.config() is deprecated, you must add parentheses instead: remote.function()
  (ecto_sql 3.10.1) lib/mix/tasks/ecto.migrate.ex:132: anonymous fn/5 in Mix.Tasks.Ecto.Migrate.run/2
  (elixir 1.17.2) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
  (ecto_sql 3.10.1) lib/mix/tasks/ecto.migrate.ex:129: Mix.Tasks.Ecto.Migrate.run/2
  (mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.17.2) lib/mix/cli.ex:96: Mix.CLI.run_task/2

warning: using map.field notation (without parentheses) to invoke function AGSupport.Repo.Migrations.AddArticlesSite.__migration__() is deprecated, you must add parentheses instead: remote.function()
  (ecto_sql 3.10.1) lib/ecto/migrator.ex:597: Ecto.Migrator.conditional_lock_for_migrations/5
  (ecto_sql 3.10.1) lib/ecto/migrator.ex:716: anonymous fn/5 in Ecto.Migrator.migrate/4
  (elixir 1.17.2) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
  (ecto_sql 3.10.1) lib/ecto/migrator.ex:715: Ecto.Migrator.migrate/4
  (ecto_sql 3.10.1) lib/ecto/migrator.ex:170: Ecto.Migrator.with_repo/3

warning: using map.field notation (without parentheses) to invoke function AGSupport.Repo.Migrations.AddArticlesSite.__migration__() is deprecated, you must add parentheses instead: remote.function()
  (ecto_sql 3.10.1) lib/ecto/migrator.ex:346: Ecto.Migrator.run_maybe_in_transaction/5
  (elixir 1.17.2) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
  (elixir 1.17.2) lib/task/supervised.ex:36: Task.Supervised.reply/4

15:14:19.025 [info] == Running 20240724150959 AGSupport.Repo.Migrations.AddArticlesSite.change/0 forward

15:14:19.026 [info] alter table articles

15:14:19.032 [info] == Migrated 20240724150959 in 0.0s

Expected behavior

No deprecation warnings are raised from Ecto code.

josevalim commented 4 months ago

Please update your dependencies.

josevalim commented 4 months ago

(It should be fixed on latest)

Jwashton commented 4 months ago

You're absolutely right. My fault entirely. Sorry about that.

josevalim commented 4 months ago

No worries! tks for the follow up!