Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saiharshavellanki committed Dec 6, 2024
1 parent 7b6a57f commit fc79745
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions docs/examples/concepts/sink.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import os
import sys
from datetime import datetime

from fennel.connectors import Kafka, S3, eval, source, sink
from fennel.datasets import dataset
from fennel.expr import col
from fennel.testing import mock

__owner__ = "[email protected]"

os.environ["KAFKA_HOST"] = "some-host"
os.environ["KAFKA_USERNAME"] = "some-username"
os.environ["KAFKA_PASSWORD"] = "some-password"
os.environ["DB_NAME"] = "some-db"
os.environ["SNOWFLAKE_USERNAME"] = "snowflake-username"
os.environ["SNOWFLAKE_PASSWORD"] = "snowflake-password"

@mock
def test_stacked_sinks(client):
from fennel.connectors import Kafka, S3, eval, source
from fennel.datasets import dataset
kafka = Kafka(
name="my_kafka",
bootstrap_servers="localhost:9092",
Expand All @@ -35,7 +41,7 @@ class UserLocation:
update_time: datetime

# docsnip stacked
from fennel.connectors import Kafka, Snowflake
from fennel.connectors import Kafka, Snowflake, sink
from fennel.datasets import dataset, pipeline, Dataset
from fennel.lib.params import inputs

Expand Down Expand Up @@ -81,4 +87,4 @@ def user_location_count(cls, dataset: Dataset):
return dataset.filter(lambda row: row["country"] != "United States")

# /docsnip
client.commit(message="some commit msg", datasets=[Order])
client.commit(message="some commit msg", datasets=[UserLocationFiltered, UserLocation])

0 comments on commit fc79745

Please sign in to comment.