Opened 2 months ago

Closed 4 weeks ago

#7391 closed change (fixed)

[python-abp] Let RPy recursively parse filter options to dicts

Reported by: rhowell Assignee: rhowell
Priority: P3 Milestone:
Module: Sitescripts Keywords:
Cc: sporz, kvas Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/30031558

Description

Background

The data team (Stephan) requested this functionality.

What to change

In rpy.py, the tuple2dict function should recursively parse filter options to dicts.

Ex.
[("action", "block"), ("options", [("third-party", "true), ...])]

gets converted to

{"action": "block", "options": [("third-party", "true"), ...]}

instead of

{"action": "block", "options": {"third-party": "true", ...}}

i.e. the nested tuples don't get converted.

Change History (5)

comment:1 Changed 2 months ago by rhowell

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 2 months ago by rhowell

I wasn't sure whether to mark this 'Ready'. Wanted to check first, if there's any reason not to implement it? Seems like a fairly small change that could help the data team. Does anyone else depend on rpy, that this change might effect?

comment:3 Changed 2 months ago by kvas

  • Priority changed from Unknown to P3
  • Ready set

python-abp should eventually get the functionality of representing the options in a more meaningful way and closer to how they are interpreted in ABP. It's already needed for example for the use case of abp-rcgen and I think the data team would also benefit from it. There's no spec for that yet and until it's implemented, this ticket is useful and it's quick so why not.

I'm happy to give guidance and feedback about better option API in python-abp. There might even be an implementation on top of an older version of it floating around somewhere. I just don't have time to do it myself right now.

comment:4 Changed 5 weeks ago by abpbot

A commit referencing this issue has landed:
Issue 7391 - Let rpy parse filter options to dicts

comment:5 Changed 4 weeks ago by rhowell

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.