lidb 1.1.1__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lidb might be problematic. Click here for more details.
- {lidb-1.1.1 → lidb-1.1.2}/PKG-INFO +1 -1
- {lidb-1.1.1 → lidb-1.1.2}/lidb/__init__.py +2 -1
- {lidb-1.1.1 → lidb-1.1.2}/lidb/database.py +8 -0
- {lidb-1.1.1 → lidb-1.1.2}/lidb.egg-info/PKG-INFO +1 -1
- {lidb-1.1.1 → lidb-1.1.2}/pyproject.toml +1 -1
- {lidb-1.1.1 → lidb-1.1.2}/README.md +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/lidb/init.py +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/lidb/parse.py +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/lidb.egg-info/SOURCES.txt +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/lidb.egg-info/dependency_links.txt +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/lidb.egg-info/requires.txt +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/lidb.egg-info/top_level.txt +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/setup.cfg +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/tests/test_conf.py +0 -0
- {lidb-1.1.1 → lidb-1.1.2}/tests/test_parse.py +0 -0
|
@@ -12,6 +12,7 @@ from pathlib import Path
|
|
|
12
12
|
from .parse import extract_table_names_from_sql
|
|
13
13
|
from .init import DB_PATH, logger, get_settings
|
|
14
14
|
import urllib
|
|
15
|
+
import polars as pl
|
|
15
16
|
|
|
16
17
|
# ======================== 本地数据库 catdb ========================
|
|
17
18
|
def tb_path(tb_name: str) -> Path:
|
|
@@ -111,6 +112,13 @@ def sql(query: str, abs_path: bool = False):
|
|
|
111
112
|
new_query = pattern.sub(lambda m: convertor[m.group(0)], query)
|
|
112
113
|
return pl.sql(new_query)
|
|
113
114
|
|
|
115
|
+
def scan(tb: str, abs_path: bool = False) -> pl.LazyFrame:
|
|
116
|
+
"""polars.scan_parquet"""
|
|
117
|
+
|
|
118
|
+
if not abs_path:
|
|
119
|
+
tb = tb_path(tb)
|
|
120
|
+
return pl.scan_parquet(tb)
|
|
121
|
+
|
|
114
122
|
def read_mysql(query: str, db_conf: str = "DATABASES.mysql"):
|
|
115
123
|
"""
|
|
116
124
|
从MySQL数据库中读取数据。
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|