Skip to content

Commit

Permalink
Fixes flake noqa issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ilumsden committed Jun 9, 2023
1 parent 335a49e commit 7a16206
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 5 additions & 2 deletions thicket/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#
# SPDX-License-Identifier: MIT

# Make flake8 ignore unused names in this file
# flake8: noqa: F401

from hatchet.query import (
Query,
ObjectQuery,
Expand Down Expand Up @@ -35,11 +38,11 @@
parse_cypher_query,
)

import hatchet.query.is_hatchet_query
from hatchet.query import is_hatchet_query


def is_thicket_query(query_obj):
return hatchet.query.is_hatchet_query(query_obj)
return is_hatchet_query(query_obj)


__all__ = [
Expand Down
6 changes: 2 additions & 4 deletions thicket/tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import re

import hatchet as ht

from thicket import Thicket
from thicket.query import Query, QueryMatcher

Expand Down Expand Up @@ -60,7 +58,7 @@ def test_new_style_query_base(rajaperf_basecuda_xl_cali):
)
)

check_query(th, hnids, query)
check_query(th, hnids, query, multi_index_mode="off")


def test_new_style_query_object(rajaperf_basecuda_xl_cali):
Expand Down Expand Up @@ -102,4 +100,4 @@ def test_old_style_query(rajaperf_basecuda_xl_cali):
)
)

check_query(th, hnids, query)
check_query(th, hnids, query, multi_index_mode="off")
2 changes: 1 addition & 1 deletion thicket/thicket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ def query(
Returns:
(Thicket): a new Thicket object containing the data that matches the query
"""
if not is_thicket_query(query_obj):
if not is_thicket_query(query_obj) or not isinstance(query_obj, (list, str)):
raise TypeError(
"Input to 'query' must be a Hatchet query (i.e., list, str, or new- or old-style query object)"
)
Expand Down

0 comments on commit 7a16206

Please sign in to comment.