alan-turing-institute / sqlsynthgen

Synthetic data for SQL databases
MIT License
11 stars 1 forks source link

Handle unrecognised column types without erroring #154

Closed Iain-S closed 1 year ago

Iain-S commented 1 year ago

We raise a ValueError in the sqlsynthgen make-generators command if we encounter a column with a type that cannot be matched to a value provider. Typically, this requires the user to specify a custom generator for the column in the config. However, that's a bit of a hurdle for a new user and we could do something easier instead:

  1. We could use a NULL generator for that column and add an inline comment to bring it to the user's attention. We would print a warning rather than stopping make-generators.
  2. We could allow a user to provide a custom mapping, which would be less verbose than asking them to specify a provider for each column with an unrecognised type.
  3. We could print a more helpful error message if we retain the current behaviour.

See also #153, which will provide a NULL generator if we go with option 1.