diff --git a/mario/query_builder.py b/mario/query_builder.py index 1dd3c03..c5110c9 100644 --- a/mario/query_builder.py +++ b/mario/query_builder.py @@ -8,6 +8,7 @@ from mario.dataset_specification import DatasetSpecification from mario.metadata import Metadata from mario.mapping import FieldMapping +from mario.utils import to_snake_case logger = logging.getLogger(__name__) @@ -172,7 +173,7 @@ def create_constraints(self, q): column = self.mapping.as_physical[constraint.item] placeholders = [] for i in range(len(constraint.allowed_values)): - parameter_name = column.replace(" ", "_") + str(i) + parameter_name = to_snake_case(column) + str(i) # Postgres style. # TODO Probably need some way of identifying which parameter style to apply. parameter = Parameter('%('+parameter_name+')s') diff --git a/setup.py b/setup.py index 310aff7..24a3869 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='mario-pipeline-tools', - version='0.62', + version='0.63', packages=['mario'], url='https://github.com/JiscDACT/mario', license='all rights reserved',