-
Notifications
You must be signed in to change notification settings - Fork 141
Description
Hey,
I'm having a trouble setting rowid_column when implementing a write API, and am trying to work out if it's a bug, or me being slow—any help appreciated!
I see that, in the source of the abstract class ForeignDataWrapper, rowid_column is a @property method that raises NotImplementedError, presumably to enforce that child classes override it. But, this means that when I do try to set it, Python angrily throws AttributeError (I guess it expects a setter method or something). So, whether you try to set it or not, it ends up running to one of the two exceptions.
I've ended up forcing the redefinition by doing this:
class MyFDW(ForeignDataWrapper):
def __init__():
<snip>
self._rowid_column = "colname"
@property
def rowid_column:
return self._rowid_column
It seems to work, but I'm worried that it's heavy-handed magic. Was it intended behaviour?
BTW, I notice the property spelled differently in the docs (row_id_column), but the source only makes reference to rowid_column. That did look like a simple typo, though the tests also seem to use the double-underscore variant too. Do they pass, and I'm just missing something?