Skip to content

Commit

Permalink
🪲 remove semgrep #1249
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Nov 7, 2023
1 parent 874ab50 commit 3655c8d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 17 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ jobs:
- name: Execute Test
run: bandit -r mabel

semgrep:
runs-on: ubuntu-latest
name: SemGrep
steps:
- uses: actions/checkout@v1
- name: Semgrep
id: semgrep
uses: returntocorp/semgrep-action@v1
with:
config: p/r2c


mypy:
name: Type Checks
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion opteryx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
_env_path = Path(".") / ".env"

# deepcode ignore PythonSameEvalBinaryExpressiontrue: false +ve, values can be different
if _env_path.exists() and (dotenv is None): # pragma: no cover # nosemgrep
if _env_path.exists() and (dotenv is None): # pragma: no cover
# using a logger here will tie us in knots
print(f"{datetime.datetime.now()} [LOADER] `.env` file exists but `dotEnv` not installed.")
elif dotenv is not None: # pragma: no cover variables from `.env`")
Expand Down
2 changes: 1 addition & 1 deletion opteryx/functions/other_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def iif(mask, true_values, false_values):
def if_null(values, replacement):
response = values
for index, value in enumerate(values):
if value is None or value != value: # nosec # nosemgrep
if value is None or value != value: # nosec
response[index] = replacement[index]
return response

Expand Down
2 changes: 1 addition & 1 deletion opteryx/third_party/pyarrow_ops/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _hash_value(val, nan=numpy.nan):
if isinstance(val, (list, numpy.ndarray, tuple)):
# XOR is faster however, x ^ x == y ^ y but x != y, so we don't use it
return functools.reduce(lambda x, y: _hash_value(f"{y}:{x}", 0), val, APOLLO_11_DURATION)
if val != val or val is None: # nosemgrep
if val != val or val is None:
# nan is a float, but hash is an int, sometimes we need this to be an int
return nan
return hash(val)
Expand Down
4 changes: 2 additions & 2 deletions tests/misc/perftest_inner_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _hash_value(vals, nan=numpy.nan):
ret.append(
functools.reduce(lambda x, y: _hash_value(f"{y}:{x}", 0), val, APOLLO_11_DURATION)
)
elif val != val or val is None: # nosemgrep
elif val != val or val is None:
# nan is a float, but hash is an int, sometimes we need this to be an int
ret.append(nan)
else:
Expand All @@ -39,7 +39,7 @@ def _hash_value_new(vals, nan=numpy.nan):
ret.append(CityHash64("".join(val.values())))
elif isinstance(val, (list, tuple)):
ret.append(CityHash64(numpy.array(val)))
elif val != val or val is None: # nosemgrep
elif val != val or val is None:
# nan is a float, but hash is an int, sometimes we need this to be an int
ret.append(nan)
else:
Expand Down

0 comments on commit 3655c8d

Please sign in to comment.