-
-
Notifications
You must be signed in to change notification settings - Fork 122
test: add complex calculation tests with filtered aggregates #652
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
Open
DGollings
wants to merge
1
commit into
ash-project:main
Choose a base branch
from
sephianl:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zachdaniel
reviewed
Nov 15, 2025
Contributor
Author
|
cleaned up |
Contributor
|
can we format/check credo? |
69ede9e to
6e3f57e
Compare
Contributor
Author
|
sure, sorry, although I semi-intentionally ignored the formatting because 'my' When I run 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.