Problem
_COLUMN_TYPE_TO_GENERATOR_INFO in datafaker/make.py mapped postgresql.UUID to a UUID generator, but did not map mssql.UNIQUEIDENTIFIER.
This caused two failure modes:
-
MS-SQL source → orm.yaml → any target: When datafaker introspects an MS-SQL source database, UNIQUEIDENTIFIER columns are reflected by SQLAlchemy as mssql.UNIQUEIDENTIFIER. Because that type was absent from _COLUMN_TYPE_TO_GENERATOR_INFO, _get_info_for_column_type returned None. The column either received no generator or fell back to the generic string generator, producing invalid UUID-shaped values.
-
PostgreSQL source → orm.yaml → MS-SQL target: When the type parser reconstructed a UNIQUEIDENTIFIER column from an orm.yaml (type string "UNIQUEIDENTIFIER"), it produced mssql.UNIQUEIDENTIFIER. The same missing-entry problem applied.
Root cause
_COLUMN_TYPE_TO_GENERATOR_INFO was initialised with postgresql.UUID but not with mssql.UNIQUEIDENTIFIER, so the generator lookup failed for every UNIQUEIDENTIFIER column in an MS-SQL schema.
Steps to fix
- Import
mssql from sqlalchemy.dialects in make.py (if not already present).
- Add an entry to
_COLUMN_TYPE_TO_GENERATOR_INFO:
mssql.UNIQUEIDENTIFIER: GeneratorInfo(
generator="generic.cryptographic.uuid",
),
- Add a unit test that verifies
_get_info_for_column_type(mssql.UNIQUEIDENTIFIER) returns a GeneratorInfo with the UUID generator.
Resolution
This fix was applied in commit 76fec75 as part of the broader MS-SQL type-parser and generator work for challenge 4.
The entry now sits alongside postgresql.UUID and sqltypes.Uuid in _COLUMN_TYPE_TO_GENERATOR_INFO (see datafaker/make.py).
Problem
_COLUMN_TYPE_TO_GENERATOR_INFOindatafaker/make.pymappedpostgresql.UUIDto a UUID generator, but did not mapmssql.UNIQUEIDENTIFIER.This caused two failure modes:
MS-SQL source → orm.yaml → any target: When datafaker introspects an MS-SQL source database,
UNIQUEIDENTIFIERcolumns are reflected by SQLAlchemy asmssql.UNIQUEIDENTIFIER. Because that type was absent from_COLUMN_TYPE_TO_GENERATOR_INFO,_get_info_for_column_typereturnedNone. The column either received no generator or fell back to the generic string generator, producing invalid UUID-shaped values.PostgreSQL source → orm.yaml → MS-SQL target: When the type parser reconstructed a
UNIQUEIDENTIFIERcolumn from an orm.yaml (type string"UNIQUEIDENTIFIER"), it producedmssql.UNIQUEIDENTIFIER. The same missing-entry problem applied.Root cause
_COLUMN_TYPE_TO_GENERATOR_INFOwas initialised withpostgresql.UUIDbut not withmssql.UNIQUEIDENTIFIER, so the generator lookup failed for everyUNIQUEIDENTIFIERcolumn in an MS-SQL schema.Steps to fix
mssqlfromsqlalchemy.dialectsinmake.py(if not already present)._COLUMN_TYPE_TO_GENERATOR_INFO:_get_info_for_column_type(mssql.UNIQUEIDENTIFIER)returns aGeneratorInfowith the UUID generator.Resolution
This fix was applied in commit 76fec75 as part of the broader MS-SQL type-parser and generator work for challenge 4.
The entry now sits alongside
postgresql.UUIDandsqltypes.Uuidin_COLUMN_TYPE_TO_GENERATOR_INFO(seedatafaker/make.py).