fix: resolve lint errors, fix pytest config, and refine documentation
swadhinbiswas committed 2 months ago
3862474
1 parent 6059196
commit 3862474
5 files changed
+9 -6
Showing 5 changed files+9-6
▼README.md
+1-1
| @@ -1,4 +1,4 @@ | ||
1 | -# ✈️ Air Traffic Analytics Platform | |
1 | +# ✈️ Air Traffic Analytics Platform | |
2 | 2 | |
3 | 3 | **A production-style batch data platform for European aviation analytics** — flight delays, weather correlations, airline benchmarking, and operational KPIs. Built on a Medallion architecture with Polars, DuckDB, dbt, FastAPI, and GitHub Actions. |
4 | 4 | |
5 | 5 | |
▼pipelines/silver.py
+3-1
| @@ -21,7 +21,9 @@ import polars as pl | ||
21 | 21 | from config.logging import logger |
22 | 22 | from config.settings import Settings, settings |
23 | 23 | |
24 | -UTC_NOW = lambda: datetime.now(UTC).isoformat() | |
24 | + | |
25 | +def UTC_NOW() -> str: | |
26 | + return datetime.now(UTC).isoformat() | |
25 | 27 | |
26 | 28 | |
27 | 29 | # ── Shared helpers ─────────────────────────────────────────────────────────── |
28 | 30 | |
▼pyproject.toml
+1-0
| @@ -46,6 +46,7 @@ target-version = "py312" | ||
46 | 46 | |
47 | 47 | [tool.pytest.ini_options] |
48 | 48 | testpaths = ["tests"] |
49 | +pythonpath = ["."] | |
49 | 50 | asyncio_mode = "auto" |
50 | 51 | markers = [ |
51 | 52 | "integration: long-running end-to-end tests", |
52 | 53 | |
▼scripts/download_hf.py
+3-3
| @@ -35,8 +35,8 @@ def download_warehouse(app_settings: Any = None) -> dict[str, Any]: | ||
35 | 35 | repo = s.huggingface_repo |
36 | 36 | |
37 | 37 | try: |
38 | - repo_info = api.repo_info(repo_id=repo, repo_type="dataset") | |
39 | - except Exception: | |
38 | + api.repo_info(repo_id=repo, repo_type="dataset") | |
39 | + except Exception: # noqa: BLE001 | |
40 | 40 | logger.warning("[hf-download] repo %s not found or not accessible", repo) |
41 | 41 | return {"skipped": True, "reason": f"repo {repo} not found"} |
42 | 42 | |
| @@ -65,7 +65,7 @@ def download_warehouse(app_settings: Any = None) -> dict[str, Any]: | ||
65 | 65 | downloaded += 1 |
66 | 66 | logger.debug("[hf-download] downloaded %s", item.path) |
67 | 67 | |
68 | - except Exception as exc: | |
68 | + except Exception as exc: # noqa: BLE001 | |
69 | 69 | logger.error("[hf-download] download failed: %s", exc) |
70 | 70 | return {"downloaded": downloaded, "error": str(exc)} |
71 | 71 | |
72 | 72 | |
▼streamlit_app.py
+1-1
| @@ -54,7 +54,7 @@ def get_connection(): | ||
54 | 54 | repo_id = os.environ.get("HF_REPO", "swadhinbiswas/air-traffic") |
55 | 55 | db_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename="air_traffic.duckdb") |
56 | 56 | return duckdb.connect(db_path, read_only=True) |
57 | - except Exception as e: | |
57 | + except Exception as e: # noqa: BLE001 | |
58 | 58 | import streamlit as st |
59 | 59 | st.error(f"Failed to connect to Hugging Face Hub: {e}") |
60 | 60 | return None |
61 | 61 | |