Skip to content

Conversation

@DGollings
Copy link
Contributor

Adds comprehensive tests for calculations that depend on filtered aggregates, including keyset pagination scenarios and SQL fragment calculations with COALESCE patterns. Includes migration for new test fields.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Regression tests

@DGollings
Copy link
Contributor Author

cleaned up

@zachdaniel
Copy link
Contributor

can we format/check credo?

@DGollings DGollings force-pushed the main branch 2 times, most recently from 69ede9e to 6e3f57e Compare November 19, 2025 12:54
@DGollings
Copy link
Contributor Author

DGollings commented Nov 19, 2025

sure, sorry, although I semi-intentionally ignored the formatting because 'my' mix format does not seem to match 'your' mix format

When I run mix format I'm left with these changes, but did not want to commit more than the files I touched/created

But fixed the whitespace issues

diff --git a/lib/migration_generator/migration_generator.ex b/lib/migration_generator/migration_generator.ex
index 425ccb5..a9d4f43 100644
--- a/lib/migration_generator/migration_generator.ex
+++ b/lib/migration_generator/migration_generator.ex
@@ -494,7 +494,7 @@ defmodule AshPostgres.MigrationGenerator do
                 end)
 
               operations
-              |> organize_operations
+              |> organize_operations()
               |> build_up_and_down()
               |> migration(repo, opts, tenant?, run_without_transaction?)
             end)
diff --git a/test/filter_test.exs b/test/filter_test.exs
index 5492864..d69ab42 100644
--- a/test/filter_test.exs
+++ b/test/filter_test.exs
@@ -1121,13 +1121,13 @@ defmodule AshPostgres.FilterTest do
            |> Ash.Query.for_read(:read)
            |> Ash.Query.filter(first_member.id != ^cm2.id)
            |> Ash.read!()
-           |> length == 4
+           |> length() == 4
 
     assert Channel
            |> Ash.Query.for_read(:read)
            |> Ash.Query.filter(first_member.id == ^cm2.id)
            |> Ash.read!()
-           |> length == 1
+           |> length() == 1
   end
 
   test "using exists with from_many?" do
@@ -1142,13 +1142,13 @@ defmodule AshPostgres.FilterTest do
            |> Ash.Query.for_read(:read)
            |> Ash.Query.filter(exists(first_member, id == ^cm2.id))
            |> Ash.read!()
-           |> length == 0
+           |> length() == 0
 
     assert Channel
            |> Ash.Query.for_read(:read)
            |> Ash.Query.filter(exists(first_member, id == ^cm1.id))
            |> Ash.read!()
-           |> length == 1
+           |> length() == 1
   end
 
   test "using `(is_nil(relationship) and other_relation_filter)` will trigger left join" do

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