lidb 1.1.1__py3-none-any.whl → 1.1.2__py3-none-any.whl

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/__init__.py CHANGED
@@ -15,8 +15,9 @@ from .database import (
15
15
  tb_path,
16
16
  read_mysql,
17
17
  read_ck,
18
+ scan,
18
19
  )
19
20
 
20
21
  from .parse import parse_hive_partition_structure
21
22
 
22
- __version__ = "1.1.1"
23
+ __version__ = "1.1.2"
lidb/database.py CHANGED
@@ -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数据库中读取数据。
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lidb
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Requires-Python: >=3.12
5
5
  Description-Content-Type: text/markdown
6
6
  Requires-Dist: dynaconf>=3.2.11
@@ -0,0 +1,8 @@
1
+ lidb/__init__.py,sha256=u1pFf2BGUvlzgHIWodik211xpJhkE-grZsFSUKO90Xk,323
2
+ lidb/database.py,sha256=VRX4qCZUSBTdrJrVZr9_WMiXx9gQDNOhmY4CCPl72hU,5560
3
+ lidb/init.py,sha256=jLHpeL5mIM4YjdMYAndZlDilMiKXJMr_51Ke3ZSJWCM,1170
4
+ lidb/parse.py,sha256=f7vfj6Nguw1WzUVEUb7fs2Oh-_2YQzB_atJhm3WGC28,3379
5
+ lidb-1.1.2.dist-info/METADATA,sha256=0sDcqhnkjl9_6IAWM5HM5rqOCtxtao4xQbNNYwboqOU,303
6
+ lidb-1.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ lidb-1.1.2.dist-info/top_level.txt,sha256=NgXJNwt6ld6oLXtW1vOPaEh-VO5R0JEX_KmGIJR4ueE,5
8
+ lidb-1.1.2.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- lidb/__init__.py,sha256=VZCL7ZEcalMMdOPBHRw8V6172JXsWyGOcE6emDN9Kag,313
2
- lidb/database.py,sha256=U1h80jgmkRfgQW8sdhb7B3ISvQJUvPefLurWMsbzqa0,5372
3
- lidb/init.py,sha256=jLHpeL5mIM4YjdMYAndZlDilMiKXJMr_51Ke3ZSJWCM,1170
4
- lidb/parse.py,sha256=f7vfj6Nguw1WzUVEUb7fs2Oh-_2YQzB_atJhm3WGC28,3379
5
- lidb-1.1.1.dist-info/METADATA,sha256=loQcZ_-S9qE-_e5fHezJF9P3NXt_caG9CnT0LOH1tLs,303
6
- lidb-1.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- lidb-1.1.1.dist-info/top_level.txt,sha256=NgXJNwt6ld6oLXtW1vOPaEh-VO5R0JEX_KmGIJR4ueE,5
8
- lidb-1.1.1.dist-info/RECORD,,
File without changes