Skip to content

fix: Ecto.Enum type wrapped in tuple - #58

Open
Ziinc wants to merge 3 commits into
danielberkompas:masterfrom
Logflare:master
Open

Ziinc wants to merge 3 commits into
danielberkompas:masterfrom
Logflare:master

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 28, 2024

Copy link
Copy Markdown

This fixes a bug with the Ecto.Enum, which seems to be wrapped in tuples.

[error] [] Task #PID<0.2169.0> started from Logflare.Vault terminating
** (FunctionClauseError) no function clause matching in Code.ensure_loaded?/1
    (elixir 1.16.0) lib/code.ex:1814: Code.ensure_loaded?({:parameterized, {Ecto.Enum, %{on_load: %{"bigquery" => :bigquery, "datadog" => :datadog, "elastic" => :elastic, "postgres" => :postgres, "webhook" => :webhook}, type: :string, embed_as: :self, on_cast: %{"bigquery" => :bigquery, "datadog" => :datadog, "elastic" => :elastic, "postgres" => :postgres, "webhook" => :webhook}, mappings: [webhook: "webhook", postgres: "postgres", bigquery: "bigquery", datadog: "datadog", elastic: "elastic"], on_dump: %{webhook: "webhook", postgres: "postgres", bigquery: "bigquery", datadog: "datadog", elastic: "elastic"}}}})
    (cloak_ecto 1.3.0) lib/cloak_ecto/migrator.ex:85: Cloak.Ecto.Migrator.cloak_field?/1
    (elixir 1.16.0) lib/enum.ex:4277: Enum.filter_list/2
    (cloak_ecto 1.3.0) lib/cloak_ecto/migrator.ex:62: Cloak.Ecto.Migrator.cloak_fields/1
    (cloak_ecto 1.3.0) lib/cloak_ecto/migrator.ex:21: Cloak.Ecto.Migrator.migrate_schema_with_data/2
    (elixir 1.16.0) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (logflare 1.8.4) lib/logflare/vault.ex:66: anonymous fn/3 in Logflare.Vault.init/1
    (elixir 1.16.0) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
Function: #Function<2.133720658/0 in Logflare.Vault.init/1>
    Args: []

@AndriiKlymchuk

Copy link
Copy Markdown

It is a breaking change in recent ecto version - https://github.com/elixir-ecto/ecto/blob/master/CHANGELOG.md?plain=1#L81
Upvoting this PR

Comment thread lib/cloak_ecto/migrator.ex
Ziinc and others added 2 commits May 12, 2025 19:17
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.

2 participants