rwnx / pynonymizer

A universal tool for translating sensitive production database dumps into anonymized copies.
https://pypi.org/project/pynonymizer/
MIT License
105 stars 38 forks source link

anyway to escape : from yaml file #99

Closed amz4u2nv closed 2 years ago

amz4u2nv commented 2 years ago

For example if strategy file is like

tables: user_session: truncate scripts: after:

it errors with - yaml.scanner.ScannerError: while scanning a quoted scalar in "test.yaml", line 5, column 82 found unexpected end of stream in "test.yaml", line 5, column 83

If i remote the : then it works, is there a way to escape, and allow the sql update allow for : in column.

Thanks

rwnx commented 2 years ago

Hi, I think the problem is that it's not valid yaml. if you want to include double quotes in a yaml string you need to encapsulate the whole string (and escape the double quotes).

I would recommend that you check out yaml handles strings to get a better understanding of the different ways you could solve this:

e.g.

tables:
  user_session: truncate
scripts:
  after:
    - "UPDATE test_lead SET details = ' \"test\": false, \"brokerName\": \"dd\"'"
amz4u2nv commented 2 years ago

Thanks, that worked