Repository navigation
Copy proposer - #158
Copy proposer#158
Conversation
Also: - fixed role change text - fixed remove all roles - allow intervals and copying from same column in aliased table
You can't copy or anchor from nullable (or via nullable) to non-nullable. You can't copy from an FK to an FK that points to a different table. Bugs fixed.
…into copy_proposer
| ] | ||
|
|
||
| def _can_copy_type(self, copy_from, copy_to) -> bool: | ||
| return type(copy_from) is type(copy_to) |
There was a problem hiding this comment.
_can_copy_type is defined but never called. Was it meant to stop copying between incompatible column types (e.g. text → int)?
There was a problem hiding this comment.
Good catch! I added a test to check that copying from a different type is not proposed, and the test failed! So, now I wired in this function.
| or a related table. | ||
| :param engine: The source database. | ||
| :param buckets: The buckets for the intervals in the source database. | ||
| """ |
There was a problem hiding this comment.
Docstring here looks copy-pasted from DateAfterProposer: says “Initialise a date after proposer”, documents a buckets param that doesn’t exist on this class, and :param anchor: should be :param anchor_related:
| """ | |
| """ | |
| Initialise a copy proposer. | |
| :param metadata: The metadata of the source database. | |
| :param column: The column to generate. | |
| :param anchor_related: The anchor column, which must be in the same | |
| table as column or a related table. | |
| :param engine: The source database. | |
| """ |
|
Shall we update the documentation Around And add a new section right after the “Date interval” table and before “Date component extraction proposers”: |
Fixes #130
Also adds a copy proposer that allows the copying of a column that has a "source" role. This can be used for all the OMOP person_id columns that should all copy from each other.