Skip to content

Commit

Permalink
Fix py code style
Browse files Browse the repository at this point in the history
  • Loading branch information
auxten committed Jun 5, 2024
1 parent 49c362b commit 152f5cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions chdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ChdbError(Exception):
_arrow_format = set({"dataframe", "arrowtable"})
_process_result_format_funs = {
"dataframe": lambda x: to_df(x),
"arrowtable": lambda x: to_arrowTable(x)
"arrowtable": lambda x: to_arrowTable(x),
}

# If any UDF is defined, the path of the UDF will be set to this variable
Expand All @@ -18,7 +18,7 @@ class ChdbError(Exception):
# UDF script path will be f"{g_udf_path}/{func_name}.py"
g_udf_path = ""

chdb_version = ('0', '6', '0')
chdb_version = ("0", "6", "0")
if sys.version_info[:2] >= (3, 7):
# get the path of the current file
current_path = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -78,8 +78,16 @@ def query(sql, output_format="CSV", path="", udf_path=""):
raise ChdbError(res.error_message())
return result_func(res)


# alias for query
sql = query

__all__ = ["ChdbError", "query", "sql", "chdb_version",
"engine_version", "to_df", "to_arrowTable"]
__all__ = [
"ChdbError",
"query",
"sql",
"chdb_version",
"engine_version",
"to_df",
"to_arrowTable",
]
2 changes: 1 addition & 1 deletion chdb/session/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def query(self, sql, fmt="CSV"):
Execute a query.
"""
return query(sql, fmt, path=self._path)

# alias sql = query
sql = query

0 comments on commit 152f5cf

Please sign in to comment.