Thanks to <@U06D0TMQ2U8> I got a little further wi...
# getting-started
j
Thanks to @pat_nadolny I got a little further with my tap-snowflake - target-mssql starter project. Now I sadly have spaces in the column names (that is one item I had to use the mapper for) and the “run” now fails. The target seems to delegate to this line of code https://github.com/storebrand/target-mssql/blob/f953a0d1b551f1584de1d5b99e26f20dae7a5ab3/singer_sdk/sinks/sql.py#L286
Copy code
property_names = list(self.conform_schema(schema)["properties"].keys())
        statement = dedent(
            f"""\
            INSERT INTO {full_table_name}
            ({", ".join(property_names)})
            VALUES ({", ".join([f":{name}" for name in property_names])})
            """
        )
For running inserts. The problem I’m hitting is that {name} has spaces, so this column “a b c” ends up as
:a b c
in the sql statement, and sqlalchemy croaks. I found someone with a slightly similar issue (I was also thinking of mapping actual column names to slugify-ied names for params), but it’s not obvious what the fix is. https://github.com/singer-io/tap-google-sheets/issues/33 I can probably tweak the singer sdk to DWIM but is there a better way?
p
Theres a conform_name method in the SDK that looks like it handles spaces by default. Its overridden in this target and looks to purposefully keep spaces. I'd suggest creating an issue. I agree that it should either not accept spaces in the name or accept spaces and handle it in the insert SQL.
e
j
Thanks @pat_nadolny and @edgar_ramirez_mondragon For anyone else finding the thread, I was able to get unstuck temporarily by renaming the fields using a view in the target. Thanks for opening the bug — I’ll help if I can