Git Product home page Git Product logo

Comments (6)

dani avatar dani commented on May 28, 2024 1

Some more info : it looks like symbols must have more chars than max_length. It doesn't panic if I use

    - schema: public
      name: surgery_patient
      transformers:
        - name: RandomString
          params:
            column: permanent_identification_number
            symbols: 012345678901234567890123456789
            min_length: 20
            max_length: 20
            keep_null: false

But the generated string is weird (eg, I get 5+99e8e+964311721988 or 26+15+306640331+27+1 even if neither + nor e are in the configured symbols)

from greenmask.

wwoytenko avatar wwoytenko commented on May 28, 2024

Hi!
Thank you for reporting the issue.
I will try to resolve your problem ASAP.

from greenmask.

wwoytenko avatar wwoytenko commented on May 28, 2024

The first problem with panic I was able to solve.

But the generated string is weird (eg, I get 5+99e8e+964311721988 or 26+15+306640331+27+1 even if neither + nor e are in the configured symbols)

The reason why it is working in this way is that YAML parser recognizes it as an integer value 1.2345678901234568e+28. In this case, I can only recommend wrapping the value into quotes

   - schema: public
      name: surgery_patient
      transformers:
        - name: RandomString
          params:
            column: "permanent_identification_number"
            symbols: "012345678901234567890123456789"
            min_length: 20
            max_length: 20
            keep_null: false

This is a limitation for now because we use casting to any and it determines the type by the literal

from greenmask.

wwoytenko avatar wwoytenko commented on May 28, 2024

I will add the information about it in docs

from greenmask.

dani avatar dani commented on May 28, 2024

The reason why it is working in this way is that YAML parser recognizes it as an integer value 1.2345678901234568e+28. In this case, I can only recommend wrapping the value into quotes

Oh, of course, I should have though about this. Thanks, I can get my random ID to be generated now :-)

from greenmask.

wwoytenko avatar wwoytenko commented on May 28, 2024

Thank you for reporting that issue.

The fix connected with panic will be published in the next release (approximately this Friday or next week).

from greenmask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.