-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for both row and column MultiIndex in dialects (#154)
* Adds support for 'new-style' queries in Thicket * Adds unit test for MultiIndex column support in QL dialects * Allows "raw" string and object dialect queries to be used in Thicket.query * Adds license header and flake8 control comment to query.py * Restores the old "example_cali" pytest fixture as "simple_cali" * Updates unit tests to use the tip of develop for Hatchet * Changes new query tests to use rajaperf_seq_O3_1M_cali fixture * Adds ruff support in pyproject.toml
- Loading branch information
Showing
5 changed files
with
197 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Copyright 2022 Lawrence Livermore National Security, LLC and other | ||
# Thicket Project Developers. See the top-level LICENSE file for details. | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
# make flake8 unused names in this file. | ||
# flake8: noqa: F401 | ||
|
||
from hatchet.query import ( | ||
# New style queries | ||
# ################# | ||
# | ||
# Core query types | ||
Query, | ||
ObjectQuery, | ||
StringQuery, | ||
parse_string_dialect, | ||
# Compound queries | ||
CompoundQuery, | ||
ConjunctionQuery, | ||
DisjunctionQuery, | ||
ExclusiveDisjunctionQuery, | ||
NegationQuery, | ||
# Errors | ||
InvalidQueryPath, | ||
InvalidQueryFilter, | ||
RedundantQueryFilterWarning, | ||
BadNumberNaryQueryArgs, | ||
# | ||
# Old style queries | ||
# ################# | ||
AbstractQuery, | ||
NaryQuery, | ||
AndQuery, | ||
IntersectionQuery, | ||
OrQuery, | ||
UnionQuery, | ||
XorQuery, | ||
SymDifferenceQuery, | ||
NotQuery, | ||
QueryMatcher, | ||
CypherQuery, | ||
parse_cypher_query, | ||
is_hatchet_query, | ||
) | ||
|
||
__all__ = [ | ||
"Query", | ||
"ObjectQuery", | ||
"StringQuery", | ||
"parse_string_dialect", | ||
"CompoundQuery", | ||
"ConjunctionQuery", | ||
"DisjunctionQuery", | ||
"ExclusiveDisjunctionQuery", | ||
"NegationQuery", | ||
"InvalidQueryPath", | ||
"InvalidQueryFilter", | ||
"RedundantQueryFilterWarning", | ||
"BadNumberNaryQueryArgs", | ||
"is_hatchet_query", | ||
] | ||
|
||
|
||
def is_new_style_query(query_obj): | ||
return issubclass(type(query_obj), Query) or issubclass( | ||
type(query_obj), CompoundQuery | ||
) | ||
|
||
|
||
def is_old_style_query(query_obj): | ||
return issubclass(type(query_obj), AbstractQuery) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters