Skip to content

Commit df06c90

Browse files
authored
Releases v0.12.1 (#254)
1 parent 901b769 commit df06c90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2833
-827
lines changed

.github/workflows/pypi-cd.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,3 @@ jobs:
7777
echo "repository=$PYPI_REPO" >> ~/.pypirc
7878
python -m pip install twine
7979
python -m twine upload -r pypi --skip-existing wheelhouse/*
80-
81-
- name: Upload artifacts to github
82-
uses: actions/upload-artifact@v4
83-
if: ${{ always() }}
84-
with:
85-
name: wheels
86-
path: ./wheelhouse

.pre-commit-config.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
minimum_pre_commit_version: 2.15.0
2+
# we use *| at the beginning of lines to make sure patterns can be written
3+
# in multiple lines with added spaces ignored
4+
exclude: "^benchmarks/.*
5+
*|^bin/.*
6+
*|^cupid/.*
7+
*|^docs/.*
8+
*|^misc/.*
9+
*|^odps/mars_extension/.*
10+
*|^odps/df/.*
11+
*|^odps/internal/ml/.*
12+
*|^odps/internal/static/.*
13+
*|^odps/internal/xlib/.*
14+
*|^odps/lib/.*
15+
*|^odps/ml/.*
16+
*|^odps/static/.*"
17+
# reserve "manual" for relatively slow hooks which we still want to run in CI
18+
default_stages: [
19+
commit,
20+
merge-commit,
21+
push,
22+
prepare-commit-msg,
23+
commit-msg,
24+
post-checkout,
25+
post-commit,
26+
post-merge,
27+
post-rewrite
28+
]
29+
ci:
30+
autofix_prs: false
31+
repos:
32+
- repo: local
33+
hooks:
34+
- id: check-yaml
35+
name: check-yaml
36+
entry: check-yaml
37+
language: python
38+
exclude: ^operators/
39+
types_or: [yaml]
40+
additional_dependencies: [pre-commit-hooks==4.4.0]
41+
- id: end-of-file-fixer
42+
name: end-of-file-fixer
43+
entry: end-of-file-fixer
44+
language: python
45+
additional_dependencies: [pre-commit-hooks==4.4.0]
46+
- id: trailing-whitespace
47+
name: trailing-whitespace
48+
entry: trailing-whitespace-fixer
49+
language: python
50+
additional_dependencies: [pre-commit-hooks==4.4.0]
51+
- id: check-illegal-windows-names
52+
name: check illegal windows names
53+
entry: Illegal windows filenames detected
54+
language: fail
55+
files: '(?i)((^|/)(\\|CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|/|$)|:)'
56+
- repo: local
57+
hooks:
58+
# Check that the copyright is configured
59+
- id: copyright-check
60+
name: copyright-check
61+
entry: python bin/copyright.py
62+
language: python
63+
files: 'odps/.*'
64+
exclude: '^odps/lib/.*|^odps/tunnel/pb/.*\.py$'
65+
types_or: [python, pyi, cython]
66+
additional_dependencies: [pyyaml]
67+
- repo: local
68+
hooks:
69+
# Replace quote replacer for black (which only supports Python >= 3.4)
70+
- id: double-quote-string-fixer
71+
name: double-quote-string-fixer
72+
entry: python bin/string_fixer.py
73+
language: python
74+
files: 'odps/.*'
75+
exclude: '^odps/lib/.*'
76+
types_or: [python, pyi, cython]
77+
args: [--replace-single]
78+
- repo: local
79+
hooks:
80+
- id: flake8
81+
name: flake8
82+
description: "Flake8"
83+
entry: flake8
84+
language: python
85+
require_serial: true
86+
types_or: [python, pyi]
87+
additional_dependencies: [flake8==5.0.4]
88+
- repo: local
89+
hooks:
90+
# NOTE: we make `black` a local hook because if it's installed from
91+
# PyPI (rather than from source) then it'll run twice as fast thanks to mypyc
92+
- id: black
93+
name: black
94+
description: "Black"
95+
entry: black
96+
language: python
97+
require_serial: true
98+
types_or: [python, pyi]
99+
additional_dependencies: [black==23.3.0]
100+
- repo: local
101+
hooks:
102+
- id: isort
103+
name: isort
104+
description: "isort"
105+
entry: isort
106+
language: python
107+
require_serial: true
108+
types_or: [python, pyi]
109+
args: [--profile, black]
110+
additional_dependencies: [isort==5.11.0]

benchmarks/perf_types.py

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,28 @@
3535
def schema():
3636
pr = cProfile.Profile()
3737
pr.enable()
38-
fields = ["bigint", "double", "datetime", "boolean", "string", "decimal"]
39-
types = ["bigint", "double", "datetime", "boolean", "string", "decimal"]
38+
fields = [
39+
"bigint",
40+
"double",
41+
"datetime",
42+
"boolean",
43+
"string",
44+
"decimal",
45+
"array",
46+
"map",
47+
"struct",
48+
]
49+
types = [
50+
"bigint",
51+
"double",
52+
"datetime",
53+
"boolean",
54+
"string",
55+
"decimal",
56+
"array<bigint>",
57+
"map<string, bigint>",
58+
"struct<key:string, value:bigint>",
59+
]
4060
try:
4161
schema = TableSchema.from_lists(fields, types)
4262
schema.build_snapshot()
@@ -50,35 +70,53 @@ def schema():
5070

5171
def test_set_record_field_bigint(schema):
5272
r = Record(schema=schema)
53-
for i in range(10**6):
73+
for _ in range(10**6):
5474
r["bigint"] = 2**63 - 1
5575

5676

5777
def test_set_record_field_double(schema):
5878
r = Record(schema=schema)
59-
for i in range(10**6):
79+
for _ in range(10**6):
6080
r["double"] = 0.0001
6181

6282

6383
def test_set_record_field_boolean(schema):
6484
r = Record(schema=schema)
65-
for i in range(10**6):
85+
for _ in range(10**6):
6686
r["boolean"] = False
6787

6888

6989
def test_set_record_field_string(schema):
7090
r = Record(schema=schema)
71-
for i in range(10**6):
91+
for _ in range(10**6):
7292
r["string"] = STRING_LITERAL
7393

7494

75-
def test_write_set_record_field_datetime(schema):
95+
def test_set_record_field_datetime(schema):
7696
r = Record(schema=schema)
77-
for i in range(10**6):
97+
for _ in range(10**6):
7898
r["datetime"] = datetime(2016, 1, 1)
7999

80100

81101
def test_set_record_field_decimal(schema):
82102
r = Record(schema=schema)
83-
for i in range(10**6):
103+
for _ in range(10**6):
84104
r["decimal"] = Decimal("1.111111")
105+
106+
107+
def test_set_record_field_array(schema):
108+
r = Record(schema=schema)
109+
for _ in range(10**6):
110+
r["array"] = [2**63 - 1]
111+
112+
113+
def test_set_record_field_map(schema):
114+
r = Record(schema=schema)
115+
for _ in range(10**6):
116+
r["map"] = {"data_key": 2**63 - 1}
117+
118+
119+
def test_set_record_field_struct(schema):
120+
r = Record(schema=schema)
121+
for _ in range(10**6):
122+
r["struct"] = ("data_key", 2**63 - 1)

docs/source/base-sql.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,12 @@ PyODPS 默认不限制能够从 Instance 读取的数据规模,但 Project Own
174174
Instance 结果的读取,此时只能使用受限读取模式读取数据,在此模式下可读取的行数受到 Project 配置限制,通常为 10000 行。如果
175175
PyODPS 检测到读取 Instance 数据被限制,且 ``options.tunnel.limit_instance_tunnel`` 未设置,会自动启用受限读取模式。
176176
如果你的 Project 被保护,想要手动启用受限读取模式,可以为 ``open_reader`` 方法增加 ``limit=True`` 选项,或者设置
177-
``options.tunnel.limit_instance_tunnel = True`` 。
177+
``options.tunnel.limit_instance_tunnel = True``\
178178

179179
在部分环境中,例如 DataWorks,``options.tunnel.limit_instance_tunnel`` 可能默认被置为 True。此时,如果需要读取\
180180
所有数据,需要为 ``open_reader`` 增加参数 `tunnel=True, limit=False` 。需要注意的是,如果 Project 本身被保护,\
181-
这两个参数\ **不能**\ 解除保护,此时应联系 Project Owner 开放相应的读权限。
181+
这两个参数\ **不能**\ 解除保护,MaxCompute 也\ **不提供**\ 绕开该权限限制读取更多数据的方法。此时应联系 Project Owner
182+
开放相应的读权限。
182183

183184
如果你所使用的 MaxCompute 只能支持旧 Result 接口,同时你需要读取所有数据,可将 SQL 结果写入另一张表后用读表接口读取
184185
(可能受到 Project 安全设置的限制)。

0 commit comments

Comments
 (0)