Skip to content

Conversation

@DohanKim
Copy link
Contributor

@DohanKim DohanKim commented Dec 3, 2025

Problem

When using Ash.bulk_create/4 with the AshPostgres data layer, upsert?: true, and return_skipped_upsert?: true, if all records are successfully inserted (none skipped due to upsert conditions), the code builds a filter with or: [] to fetch skipped records, which triggers a crash:

  ** (FunctionClauseError) no function clause matching in Ash.Filter.parse_and_join/3
      (ash 3.9.0) lib/ash/filter/filter.ex:4711: Ash.Filter.parse_and_join([], :or, %{...})

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.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

…ly inserted, for return_skipped_upsert?: true
@DohanKim DohanKim changed the title do not build query filter with or: [] when all records are successfully inserted, for return_skipped_upsert?: true do not build query filter with or: [] when all records are successfully upserted, for return_skipped_upsert?: true Dec 3, 2025
@zachdaniel zachdaniel merged commit 23cc10a into ash-project:main Dec 4, 2025
64 of 67 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

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