Skip to content

Commit 17475bc

Browse files
committed
debugging LLM classification
1 parent b282abc commit 17475bc

1 file changed

Lines changed: 18 additions & 35 deletions

File tree

‎src/stacktrend/notebooks/github_data_ingestion.py‎

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -54,46 +54,29 @@
5454
# MAGIC In Fabric Data Factory, the Web Activity output will be passed as a notebook parameter
5555

5656
# COMMAND ----------
57-
# Get the GitHub API response from pipeline parameter
57+
# PARAMETERS CELL: Define parameters that Data Factory will pass
58+
# This cell must be marked as "parameter cell" in Fabric (click ... → Toggle parameter cell)
59+
github_api_response = ""
60+
61+
# COMMAND ----------
62+
# Get the GitHub API response from Data Factory parameter
5863
print("DEBUGGING: Checking for Data Factory pipeline parameters...")
59-
github_response = None
6064

61-
try:
62-
from notebookutils import mssparkutils
63-
64-
# Get all parameters for debugging
65-
params = mssparkutils.notebook.getParameters()
66-
print(f"All available parameters: {list(params.keys())}")
67-
68-
if 'github_api_response' in params:
69-
github_response = params['github_api_response']
70-
print("SUCCESS: Found 'github_api_response' parameter")
65+
# Validate parameter from Data Factory
66+
if github_api_response and str(github_api_response).strip():
67+
# Check if it's not just empty/null values
68+
if str(github_api_response).strip() not in ["null", "None", "{}", "[]", ""]:
69+
github_response = github_api_response
70+
print("SUCCESS: Found 'github_api_response' parameter from Data Factory")
7171
print(f"Parameter type: {type(github_response)}")
7272
print(f"Parameter length: {len(str(github_response))} characters")
73-
74-
# Check if it's empty or just whitespace
75-
if not github_response or str(github_response).strip() == "":
76-
print("WARNING: Parameter exists but is empty or whitespace")
77-
github_response = None
78-
elif str(github_response).strip() in ["null", "None", "{}", "[]"]:
79-
print("WARNING: Parameter contains null/empty values")
80-
github_response = None
81-
else:
82-
print(f"SUCCESS: Valid parameter received: {str(github_response)[:200]}...")
73+
print(f"SUCCESS: Valid parameter received: {str(github_response)[:200]}...")
8374
else:
84-
print("ERROR: 'github_api_response' parameter not found")
85-
86-
# Try alternative parameter names
87-
alternative_names = ['github_response', 'api_response', 'web_activity_output']
88-
for alt_name in alternative_names:
89-
if alt_name in params:
90-
print(f"Found alternative parameter: {alt_name}")
91-
github_response = params[alt_name]
92-
break
93-
94-
except Exception as e:
95-
print(f"ERROR: Error accessing pipeline parameters: {e}")
96-
raise
75+
print("WARNING: Parameter contains null/empty values")
76+
github_response = None
77+
else:
78+
print("ERROR: 'github_api_response' parameter not found or empty")
79+
github_response = None
9780

9881
# Final parameter validation
9982
if github_response:

0 commit comments

Comments
 (0)