Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
run: pipx install poetry

- name: Install dependencies
run: poetry install --with dev --extras all

- name: Lint
run: poetry run flake8 .

- name: Typecheck
run: poetry run mypy .

- name: Format
run: poetry run black .

- name: Test
run: poetry run pytest -n auto
36 changes: 35 additions & 1 deletion avrokit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
... writer.roll() # Create a new partition file
"""

from .url import URL, parse_url, create_url_mapping
from .url import URL, FileURL, parse_url, create_url_mapping, flatten_urls
from .io import (
Appendable,
PartitionedAvroReader,
PartitionedAvroWriter,
TimePartitionedAvroWriter,
Expand All @@ -88,16 +89,46 @@
avro_writer,
avro_records,
compact_avro_data,
read_avro_schema,
read_avro_schema_from_first_nonempty_file,
validate_avro_schema_evolution,
)
from .asyncio import DeferredAvroWriter, BlockingQueueAvroReader
from .tools import (
CatTool,
ConcatTool,
FileSortTool,
FromParquetTool,
GetMetaTool,
GetSchemaTool,
HttpServerTool,
PartitionTool,
RepairTool,
StatsTool,
ToJsonTool,
ToParquetTool,
)

__all__ = [
"Appendable",
"BlockingQueueAvroReader",
"CatTool",
"ConcatTool",
"DeferredAvroWriter",
"FileSortTool",
"FileURL",
"FromParquetTool",
"GetMetaTool",
"GetSchemaTool",
"HttpServerTool",
"PartitionTool",
"PartitionedAvroReader",
"PartitionedAvroWriter",
"RepairTool",
"StatsTool",
"TimePartitionedAvroWriter",
"ToJsonTool",
"ToParquetTool",
"URL",
"add_avro_schema_fields",
"avro_reader",
Expand All @@ -106,6 +137,9 @@
"avro_records",
"compact_avro_data",
"create_url_mapping",
"flatten_urls",
"parse_url",
"read_avro_schema",
"read_avro_schema_from_first_nonempty_file",
"validate_avro_schema_evolution",
]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[tool.poetry]
name = "avrokit"
version = "0.0.1"
version = "0.0.2"
description = "Python utilities for working with Avro data files"
authors = ["Greg Brandt <brandt.greg@gmail.com>"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_additional_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_file_url_nonexistent_read(self):
"""Test reading from non-existent file."""
url = parse_url("/tmp/nonexistent_file_12345.avro")
with pytest.raises(FileNotFoundError):
with url.with_mode("rb") as f:
with url.with_mode("rb") as _:
pass

def test_file_url_exists_check(self):
Expand Down
Loading