Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sqlalchemy): reflect most recent schema when view is replaced
This may be too coarse of a method for this. This is a fix for creating a table or view with the same name as an existing table or view. This is most likely to occur when using the various `parquet` and `csv` registration features, because we do a lot of `CREATE OR REPLACE VIEW`. Before this, the ibis table would reflect the schema of the initial registration, but would not update if you try to re-use the same view name for a different file (with a different schema). Other fixes I tried: `sa.table(..., extend_existing=True)` This works if the subsequently registered schema is a superset of the existing schema, but if it's a subset, then you end up with a union of the two registration runs. Calling `reflect_table` This is actually already happening, but it refers to the contents of `self.meta` -- this oddly seems to update the _types_ of any columns if that is merited, but doesn't drop columns that are no longer present in the most recent view. Manually popping out columns It's called an ImmutableColumnCollection for a reason, I guess.
- Loading branch information