Skip to content

Commit

Permalink
Update datanommer-models to 1.4.0: add the agents and not_agents
Browse files Browse the repository at this point in the history
…parameters
  • Loading branch information
abompard committed Jun 12, 2024
1 parent 5753835 commit e7dd9f1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions datagrepper/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def raw():
packages = flask.request.args.getlist("package")
categories = flask.request.args.getlist("category")
topics = flask.request.args.getlist("topic")
agents = flask.request.args.getlist("agent")
contains = flask.request.args.getlist("contains")
# Validate the "contains" argument
_contains_limit = datetime.utcnow() - timedelta(weeks=4 * 8)
Expand All @@ -263,6 +264,7 @@ def raw():
not_packages = flask.request.args.getlist("not_package")
not_categories = flask.request.args.getlist("not_category")
not_topics = flask.request.args.getlist("not_topic")
not_agents = flask.request.args.getlist("not_agent")

# Paging arguments
page = int(flask.request.args.get("page", 1))
Expand Down Expand Up @@ -296,11 +298,13 @@ def raw():
packages=packages,
categories=categories,
topics=topics,
agents=agents,
contains=contains,
not_users=not_users,
not_packages=not_packages,
not_categories=not_categories,
not_topics=not_topics,
not_agents=not_agents,
page=page,
rows_per_page=rows_per_page,
order=order,
Expand All @@ -321,11 +325,13 @@ def raw():
packages=packages,
categories=categories,
topics=topics,
agents=agents,
contains=contains,
not_users=not_users,
not_packages=not_packages,
not_categories=not_categories,
not_topics=not_topics,
not_agents=not_agents,
)
except Exception as e:
traceback.print_exc()
Expand Down Expand Up @@ -433,13 +439,15 @@ def make_charts(chart_type):
packages = flask.request.args.getlist("package")
categories = flask.request.args.getlist("category")
topics = flask.request.args.getlist("topic")
agents = flask.request.args.getlist("agent")
contains = flask.request.args.getlist("contains")

# Still more filters.. negations of the previous ones.
not_users = flask.request.args.getlist("not_user")
not_packages = flask.request.args.getlist("not_package")
not_categories = flask.request.args.getlist("not_category")
not_topics = flask.request.args.getlist("not_topic")
not_agents = flask.request.args.getlist("not_agent")

end = end and datetime.fromtimestamp(end)
start = start and datetime.fromtimestamp(start)
Expand Down Expand Up @@ -523,6 +531,7 @@ def make_charts(chart_type):
packages=packages,
categories=categories,
topics=topics,
agents=agents,
contains=contains,
)

Expand All @@ -548,6 +557,7 @@ def make_charts(chart_type):
not_packages=not_packages,
not_categories=not_categories,
not_topics=not_topics,
not_agents=not_agents,
**kwargs,
)
values.append(count)
Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e7dd9f1

Please sign in to comment.