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
Properly set filter rules for geo answers #195
Conversation
@ross, verified and confirmed working ok |
octodns/provider/ns1.py
Outdated
if has_country: | ||
if len(params['answers']) > 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this change probably needs a corresponding tweak in the tests as this if
always evaluates to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that if check is unnecessary (since as you pointed out it's always true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would removing it still apply a "shuffle" filter to records with a single answer? Not sure that'd be a problem, but I assume that was the original intent behind the if > 1
From my understanding, the shuffle filter needs to be present if there is
any geotarget involved.
…On Feb 15, 2018 10:52 AM, "Ross McFarland" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In octodns/provider/ns1.py
<#195 (comment)>:
> if has_country:
+ if len(params['answers']) > 1:
Would removing it still apply a "shuffle" filter to records with a single
answer? Not sure that'd be a problem, but I assume that was the original
intent behind the if > 1
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#195 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAvgKa5tMYBpLJAsGEo4qIu80kWkaqyNks5tVFKpgaJpZM4SD5tV>
.
|
The original intent was to handle shuffle when there was multiple answers
(regardless of geotarget). That seems to have been a misunderstanding of
our internal api
…On Feb 15, 2018 11:04 AM, "Stephen Coursen" ***@***.***> wrote:
From my understanding, the shuffle filter needs to be present if there is
any geotarget involved.
On Feb 15, 2018 10:52 AM, "Ross McFarland" ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In octodns/provider/ns1.py
> <#195 (comment)>:
>
> > if has_country:
> + if len(params['answers']) > 1:
>
> Would removing it still apply a "shuffle" filter to records with a single
> answer? Not sure that'd be a problem, but I assume that was the original
> intent behind the if > 1
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#195 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAvgKa5tMYBpLJAsGEo4qIu80kWkaqyNks5tVFKpgaJpZM4SD5tV>
> .
>
|
OK. |
Only set filter rules when geo target information is configured. If the answer has no geo target, don't set the rules.