-
Notifications
You must be signed in to change notification settings - Fork 327
[hma][api] bank_get_content can optionally return signals #1763
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
base: main
Are you sure you want to change the base?
[hma][api] bank_get_content can optionally return signals #1763
Conversation
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.
Okay, this is a toughie, so bear with me. Thanks for testing.
My primary concerns are:
- Making sure we don't degrade performance for the matching usecase, which doesn't need signals
- Making sure the solution solves the usecase for the folks who need [hma] Add the ability to GET the signals from a content_id #1761
- Come up with a simple solution
I think after noodling on it a bit, I think I am convinced that folks will be wanting to do the fetch on signals at the same time they are getting banked_content, which is how you've implemented it in the interface. My recommendation is to adjust the return value of the get_signals interface to return those as separate components to handle this, and for the second component to be none/empty if not requested.
However, I believe this PR is always fetching the signals (I believe via a hidden interaction on the property for .signals
), even if we are going to ignore them later, so I think we need to adjust the postgres impl to make sure we aren't fetching them.
On the API interface itself for getting banked content, please make it so the key for "signals" does not appear if the user hasn't requested it - it's confusing to have it empty (or populated due to cost) if it's not requested.
EDIT: Whoops, forgot to hit request changes.
I think your base is overall solid, and since your unittest is on the API interface you don't have to change much on that side.
hasher-matcher-actioner/src/OpenMediaMatch/blueprints/matching.py
Outdated
Show resolved
Hide resolved
hasher-matcher-actioner/src/OpenMediaMatch/blueprints/matching.py
Outdated
Show resolved
Hide resolved
hasher-matcher-actioner/src/OpenMediaMatch/storage/interface.py
Outdated
Show resolved
Hide resolved
hasher-matcher-actioner/src/OpenMediaMatch/storage/interface.py
Outdated
Show resolved
Hide resolved
hasher-matcher-actioner/src/OpenMediaMatch/blueprints/curation.py
Outdated
Show resolved
Hide resolved
hasher-matcher-actioner/src/OpenMediaMatch/blueprints/curation.py
Outdated
Show resolved
Hide resolved
hasher-matcher-actioner/src/OpenMediaMatch/blueprints/curation.py
Outdated
Show resolved
Hide resolved
hasher-matcher-actioner/src/OpenMediaMatch/blueprints/matching.py
Outdated
Show resolved
Hide resolved
consistency?
maybe be more faithful to the original stuff, but we can revert
07a9aa8
to
5532174
Compare
see if we can match the tests, and change the query type to resolve test failures
…e query itself: might fix the actual tests failure
update some commentary and the query to only fetch when requested Fix the type only if requested this does it? this only updates but shouldn't this pass? remove a redundant test
5532174
to
4b88738
Compare
I haven't hit resolve on a few blocking comments that I don't have a particular opinion on. I think this is ready for a second look, if you're able to. I think, maybe I could make the interface changes in another PR, either separate or combined with the second needed one about more of the nitty gritty implementation. |
Hey @vincent-4! I lost track of this one, let me self-put it up for review, and I might do some work to split out some of the changes to help land it, sorry for the delay! |
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.
Hey @vincent-4 - sorry for the long delay here, I lost the thread on this one.
I think the functionality presented is fine, and just think we should very slightly tweak the interface. I am happy to bring this one in for a landing, since it's been literal months since we talked.
I have a meeting with some of the users later today, and based on that I may commandeer this one and finish these comments to land.
hasher-matcher-actioner/src/OpenMediaMatch/storage/interface.py
Outdated
Show resolved
Hide resolved
hasher-matcher-actioner/src/OpenMediaMatch/storage/postgres/database.py
Outdated
Show resolved
Hide resolved
Co-authored-by: David Callies <[email protected]>
…tabase.py Co-authored-by: David Callies <[email protected]>
Summary
An attempt:
Not 100% on the DB stuff. I'm having issues running tests locally, so I'm mainly putting this up for now to see the CI workflow output. If there are failures, feel free to come back later, when it would make more sense.
Test Plan
Yes, new tests in PR: tests are pretty self-explanatory, in this case at least.
Edit: This is woards #1761