Skip to content

Commit

Permalink
chore: update version
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed Dec 8, 2023
1 parent 691f431 commit b787d3f
Show file tree
Hide file tree
Showing 8 changed files with 788 additions and 662 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## 0.2

### 0.2.3

- Support json column. (#73)
- Fix connection with `secure=True` and `verify=False`.
- Fix compression.
- Fix exception `Cannot set verify_mode to CERT_NONE when check_hostname is enabled`.

### 0.2.2

- Add `Int128Column`, `Int256Column`, `UInt128Column`, `UInt256Column`, `Decimal256Column`. (#57)
Expand Down
18 changes: 2 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ checkfiles = asynch/ tests/ benchmark/
black_opts = -l 100 -t py38
py_warn = PYTHONDEVMODE=1

help:
@echo "asynch development makefile"
@echo
@echo "usage: make <target>"
@echo "Targets:"
@echo " up Ensure dev/test dependencies are updated"
@echo " deps Ensure dev/test dependencies are installed"
@echo " check Checks that build is sane"
@echo " test Runs all tests"
@echo " style Auto-formats the code"
@echo " build Build package"
@echo " clean Clean old build"

up:
@poetry update

Expand All @@ -32,9 +19,8 @@ style: deps
@black $(black_opts) $(checkfiles)

check: deps
@black --check $(black_opts) $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
@pflake8 $(checkfiles)
@bandit -x tests -r $(checkfiles) -s B107
@black --check $(checkfiles)
@ruff $(checkfiles) --fix

test: deps
$(py_warn) pytest
Expand Down
19 changes: 11 additions & 8 deletions asynch/proto/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,22 @@
UnknownPacketFromServerError,
)
from asynch.proto import constants
from asynch.proto.block import BlockStreamProfileInfo, ColumnOrientedBlock, RowOrientedBlock
from asynch.proto.block import (
BlockStreamProfileInfo,
ColumnOrientedBlock,
RowOrientedBlock,
)
from asynch.proto.compression import get_compressor_cls
from asynch.proto.context import Context, ExecuteContext
from asynch.proto.cs import ClientInfo, QueryKind, ServerInfo
from asynch.proto.progress import Progress
from asynch.proto.protocol import ClientPacket, Compression, ServerPacket
from asynch.proto.result import IterQueryResult, ProgressQueryResult, QueryInfo, QueryResult
from asynch.proto.result import (
IterQueryResult,
ProgressQueryResult,
QueryInfo,
QueryResult,
)
from asynch.proto.settings import write_settings
from asynch.proto.streams.block import BlockReader, BlockWriter
from asynch.proto.streams.buffered import BufferedReader, BufferedWriter
Expand Down Expand Up @@ -475,7 +484,6 @@ async def packet_generator(self) -> AsyncGenerator:
yield packet

async def receive_result(self, with_column_types=False, progress=False, columnar=False):

generator = self.packet_generator()

if progress:
Expand Down Expand Up @@ -542,7 +550,6 @@ async def _init_connection(self, host: str, port: int):
await self.receive_hello()

def reset_state(self):

self.writer = None
self.reader = None
self.block_reader = None
Expand Down Expand Up @@ -624,7 +631,6 @@ async def execute(

start_time = time()
async with ExecuteContext(self, query, settings):

# INSERT queries can use list/tuple/generator of list/tuples/dicts.
# For SELECT parameters can be passed in only in dict right now.
is_insert = isinstance(args, (list, tuple, GeneratorType))
Expand Down Expand Up @@ -709,7 +715,6 @@ async def process_ordinary_query_with_progress(
types_check=False,
columnar=False,
):

if params is not None:
query = self.substitute_params(query, params)

Expand Down Expand Up @@ -762,7 +767,6 @@ async def process_ordinary_query(
types_check=False,
columnar=False,
):

if params is not None:
query = self.substitute_params(query, params)

Expand Down Expand Up @@ -870,7 +874,6 @@ async def iter_process_ordinary_query(
query_id=None,
types_check=False,
):

if params is not None:
query = self.substitute_params(query, params)

Expand Down
1 change: 0 additions & 1 deletion asynch/proto/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
async def write_settings(
writer: BufferedWriter, settings: Dict, settings_as_strings, settings_is_important: bool
):

for setting, value in (settings or {}).items():
# If the server support settings as string we do not need to know
# anything about them, so we can write any setting.
Expand Down
1,382 changes: 757 additions & 625 deletions poetry.lock

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "asynch"
version = "0.2.2"
version = "0.2.3"
description = "A asyncio driver for ClickHouse with native tcp protocol"
authors = ["long2ice <[email protected]>"]
license = "Apache-2.0"
Expand Down Expand Up @@ -28,8 +28,7 @@ ciso8601 = "*"
compression = ["clickhouse-cityhash"]

[tool.poetry.dev-dependencies]
flake8 = "*"
pyproject-flake8 = "*"
ruff = "*"
isort = "*"
black = "*"
pytest = "*"
Expand All @@ -40,16 +39,18 @@ clickhouse-driver = "*"
uvloop = "*"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]

[tool.isort]
profile = "black"

[tool.black]
line-length = 100
target-version = ["py36", "py37", "py38", "py39"]

[tool.flake8]
ignore = "E501,W503,DAR101,DAR201,DAR402"
max-line-length = 100
target-version = ['py38', 'py39', 'py310', 'py311']

[tool.pytest.ini_options]
asyncio_mode = "auto"

[tool.ruff]
line-length = 100
1 change: 0 additions & 1 deletion tests/test_proto/columns/test_geotypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ async def create_table(cursor, spec):
],
)
async def test_get_types(conn, spec, data):

async with conn.cursor() as cursor:
await cursor.execute("set allow_experimental_geo_types = 1")
async with create_table(cursor, spec):
Expand Down
1 change: 0 additions & 1 deletion tests/test_proto/columns/test_nestedcolumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ async def test_nested_column(conn, data, expected_dict):
("n.i", expected_dict["i"]),
("n.s", expected_dict["s"]),
):

await cursor.execute(f"SELECT {select_str} FROM test.test")
assert await cursor.fetchall() == expected

Expand Down

0 comments on commit b787d3f

Please sign in to comment.