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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ pipeline:
handler_config:
project: "apache-beam-testing"
table_name: "apache-beam-testing.ALL_TEST.customers"
row_restriction_template: "customer_id = 1001 or customer_id = 1003"
# Use placeholder format string so values from 'fields' dynamically populate the WHERE clause.
row_restriction_template: "customer_id = {}"
fields: ["customer_id"]

# Step 3: Map enriched values to Beam schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ pipeline:

options:
yaml_experimental_features: [ 'ML' ]
temp_location: "gs://apache-beam-testing/temp"
# Dynamic temp location avoids hardcoding inaccessible staging buckets across environments.
temp_location: "{{ WAREHOUSE }}/temp"


# Expected:
# Row(id=1, date='2024-10-01', time='12:00:00', level='INFO', process='Main', component='ComponentA', content='System started successfully', embedding=[0.13483997249264842, 0.26967994498529685, 0.40451991747794525, 0.5393598899705937, 0.674199862463242])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def __init__(self):
def load_data(self):
logging.info("Querying vector embeddings from BigQuery...")

client = bigquery.Client()
# Extract project from table spec to avoid failures when no default project configured.
project = self.bq_table.split('.')[0] if '.' in self.bq_table else None
client = bigquery.Client(project=project)
sql = f"""
SELECT *
FROM `{self.bq_table}`
Expand Down
Loading