Skip to content

Commit

Permalink
Add source-hackernews connector
Browse files Browse the repository at this point in the history
  • Loading branch information
danthelion committed Jun 18, 2024
1 parent e6e026f commit 7ca5586
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source-hackernews/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "source_hackernews"
version = "0.1.0"
description = ""
authors = ["Johnny Graettinger <johnny@estuary.dev>"]
authors = ["Dani Palma <dani@estuary.dev>"]

[tool.poetry.dependencies]
estuary-cdk = {path="../estuary-cdk", develop = true}
Expand Down
5 changes: 0 additions & 5 deletions source-hackernews/source_hackernews/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from datetime import datetime, timedelta
from decimal import Decimal

from estuary_cdk.capture.common import PageCursor, LogCursor
from estuary_cdk.http import HTTPSession
from logging import Logger
Expand All @@ -17,8 +14,6 @@
async def fetch_page(http: HTTPSession, log: Logger, start_cursor: PageCursor, log_cutoff: LogCursor):
url = f"{API}/v0/item/{start_cursor}.json"

# TODO batch
# TODO handle http errors
req = await http.request(log, url)

item = Item.model_validate_json(req)
Expand Down
2 changes: 2 additions & 0 deletions source-hackernews/tests/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def test_capture(request, snapshot):

assert snapshot("stdout.json") == lines


def test_discover(request, snapshot):
result = subprocess.run(
[
Expand All @@ -42,6 +43,7 @@ def test_discover(request, snapshot):

assert snapshot("stdout.json") == lines


def test_spec(request, snapshot):
result = subprocess.run(
[
Expand Down

0 comments on commit 7ca5586

Please sign in to comment.