Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain currency values are invalid #73

Closed
dshore opened this issue Jun 24, 2021 · 5 comments
Closed

Certain currency values are invalid #73

dshore opened this issue Jun 24, 2021 · 5 comments
Labels
bug Something isn't working in DEV Resolution is in DEV release

Comments

@dshore
Copy link
Collaborator

dshore commented Jun 24, 2021

Description

I configured a custom granularity with a minimum of 4.51

What I Did

rate:
  currency: "USD" # required
  granularity:
    type: "custom" # required, choices: "low", "med", "high", "auto", "dense", "custom"
    custom:
      - min: 4.51
        max: 50.00
        interval: 0.01

What happened

Error: Check your configfile for the following validation errors:
  - Path(rate, granularity, custom, 0, min): 4.51 is not a multiple of 0.01
@dshore dshore added the bug Something isn't working label Jun 24, 2021
@lucop1
Copy link

lucop1 commented Oct 11, 2021

Hi, any news on this bug? I cannot create order with the following granularity:

rate:
  currency: "EUR" # required
  granularity:
    type: "custom" # required, choices: "low", "med", "high", "auto", "dense", "custom"
    custom: # optional, requires type "custom" above
      - min: 0.01
        max: 2.00
        interval: 0.01
      - min: 2.02
        max: 5.00
        interval: 0.02
      - min: 5.10
        max: 10.00
        interval: 0.10
      - min: 10.25
        max: 20.00
        interval: 0.25

@ocm-peter
Copy link

ocm-peter commented Nov 20, 2021

Same error for the below configuration:

rate:
  currency: "EUR" # required
  granularity:
    type: "custom" # required, choices: "low", "med", "high", "auto", "dense", "custom"
    custom: # optional, requires type "custom" above
      - min: 0.01
        max: 2.00
        interval: 0.01
      - min: 2.02
        max: 5.00
        interval: 0.02
      - min: 5.10
        max: 10.00
        interval: 0.10
      - min: 10.25
        max: 20.00
        interval: 0.25
Error: Check your configfile for the following validation errors:
  - Path(rate, granularity, custom, 1, min): 2.01 is not a multiple of 0.01
  - Path(rate, granularity, custom, 2, min): 4.01 is not a multiple of 0.01

dshore added a commit that referenced this issue Jan 26, 2022
Validate bucket schema without using json multipleOf (#73)
@dshore dshore added the in DEV Resolution is in DEV release label Jan 26, 2022
@dshore
Copy link
Collaborator Author

dshore commented Jan 26, 2022

@lucop1 @ocm-peter A fix for this is available as a dev release:

$ pip uninstall line-item-manager
$ pip install https://github.com/prebid/line-item-manager/archive/master.zip
$ line_item_manager --version
line-item-manager version 0.2.4-dev2

@lucop1
Copy link

lucop1 commented Jan 27, 2022

Hi @dshore unfortunately still getting same error using dev release:
Error: Bucket min, 5.1, is not a multiple of 0.01

dshore added a commit that referenced this issue Jan 27, 2022
Round rate currencies to nearest hundreth (#73)
@dshore
Copy link
Collaborator Author

dshore commented Jan 27, 2022

@lucop1 Thanks for feedback, please try again. I have removed the "multipleOf" check and made a note in the config template that rate currencies will be rounded to the closest hundredth. This should unblock you, but I think the best thing to do is add in precision support, i.e. you can think of this current dev release as a hard coded precision of 2.

$ pip uninstall line-item-manager
$ pip install https://github.com/prebid/line-item-manager/archive/master.zip
$ line_item_manager --version
line-item-manager version 0.2.4-dev3

@dshore dshore mentioned this issue Feb 8, 2022
@dshore dshore closed this as completed Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in DEV Resolution is in DEV release
Projects
None yet
Development

No branches or pull requests

3 participants