Skip to content

Commit

Permalink
Return type mismatch (#1554)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemeljanov authored Feb 29, 2024
1 parent 4ed4a7e commit 4780493
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions hasher-matcher-actioner/hmalib/indexers/lcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ class LCCIndexer:
def get_recent_index(cls, storage_path, signal_type) -> PDQIndex:
"""Get the most recent index."""
directory = os.path.join(storage_path, signal_type)
latest_directory = max(pathlib.Path(directory).glob("*/"), key=os.path.getmtime)
latest_directory = max(pathlib.Path(
directory).glob("*/"), key=os.path.getmtime)

with open(latest_directory, "rb") as f:
return pickle.load(f)

@classmethod
def build_index_from_last_24h(cls, signal_type, storage_path, bucket_width) -> None:
def build_index_from_last_24h(cls, signal_type, storage_path, bucket_width) -> PDQIndex:
"""Create an index"""
with metrics.timer(metrics.names.lcc.get_data):
d = timedelta(days=1)

# Make 3 different metric.timers
# get_Recrods, record_list, and .build
# get_records, record_list, and .build
past_day_content = TimeBucketizer.get_records(
(datetime.now() - d),
datetime.now(),
Expand Down
1 change: 0 additions & 1 deletion python-threatexchange/threatexchange/cli/config_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def execute(self, settings: CLISettings) -> None:


class ConfigCollabPrintCommand(command_base.Command):

"""
Print a collab config to screen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ def from_threatexchange_json(
for owner in reaction["value"].split(","):
owner_id = int(owner)
if rxn == "HELPFUL":
implicit_opinions[
owner_id
] = state.SignalOpinionCategory.POSITIVE_CLASS
implicit_opinions[owner_id] = (
state.SignalOpinionCategory.POSITIVE_CLASS
)
elif (
rxn == "DISAGREE_WITH_TAGS"
and owner_id not in implicit_opinions
):
implicit_opinions[
owner_id
] = state.SignalOpinionCategory.NEGATIVE_CLASS
implicit_opinions[owner_id] = (
state.SignalOpinionCategory.NEGATIVE_CLASS
)

for owner_id, category in implicit_opinions.items():
if owner_id in explicit_opinions:
Expand Down

0 comments on commit 4780493

Please sign in to comment.