diff --git a/src/dataregistry/registrar/base_table_class.py b/src/dataregistry/registrar/base_table_class.py index 01a2e01e..9f06ad77 100644 --- a/src/dataregistry/registrar/base_table_class.py +++ b/src/dataregistry/registrar/base_table_class.py @@ -56,6 +56,7 @@ def __init__(self, db_connection, root_dir, owner, owner_type): # Database engine and dialect. self._engine = db_connection.engine self._schema = db_connection.schema + self._dialect = db_connection._dialect # Link to Table Metadata. self._metadata_getter = TableMetadata(db_connection) diff --git a/src/dataregistry/registrar/dataset.py b/src/dataregistry/registrar/dataset.py index b10f6793..35e659fa 100644 --- a/src/dataregistry/registrar/dataset.py +++ b/src/dataregistry/registrar/dataset.py @@ -118,13 +118,11 @@ def _validate_register_inputs( if kwargs_dict["owner"] != "production": raise ValueError("`owner` for production datasets must be 'production'") else: - if ( - self._metadata_getter.is_production_schema - or kwargs_dict["test_production"] - ): - raise ValueError( - "Only owner_type='production' can go in the production schema" - ) + if self._dialect != "sqlite" and not kwargs_dict["test_production"]: + if self._metadata_getter.is_production_schema: + raise ValueError( + "Only owner_type='production' can go in the production schema" + ) # Validate the keywords (make sure they are registered) if len(kwargs_dict["keywords"]) > 0: