Skip to content

Conversation

james-johnston-thumbtack

resolves #704

Problem

The equality test only needs a Relation when it needs to examine the model schema using the adapter. If the user provides all column names to compare, and does not use the 'precision' option, then no Relation is actually needed. In this case, an arbitrary subquery can be passed instead. For example, the output of the get_where_subquery macro can be used instead.

This was discussed at: #704 (comment)

It would make sense to solve that by moving the is_relation check into here, as it's the only place that would cause a problem:

The issue seems to have been closed due to inactivity and the absence of a PR.

Solution

I moved the _is_relation checks to be just prior to the adapter calls. If no adapter call is needed, then we don't assert that the model is a relation.

Checklist

  • This code is associated with an issue which has been triaged and accepted for development.
  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the README.md (if applicable)
    • It's not clear to me that this merits documenting in the README. Happy to update if you feel otherwise.

NOTE: i tested locally using postgres target.

The equality test only needs a Relation when it needs to examine the
model schema using the adapter.  If the user provides all column names
to compare, and does not use the 'precision' option, then no Relation
is actually needed.  In this case, an arbitrary subquery can be passed
instead.  For example, the get_where_subquery can be used.
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.

equality test with where config

1 participant