Skip to content

Commit b3ea794

Browse files
revert pr template, extract handler, remove test readme
1 parent 470938a commit b3ea794

File tree

3 files changed

+7
-348
lines changed

3 files changed

+7
-348
lines changed

.github/pull_request_template

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,3 @@
33
# what changed
44

55
# test plan
6-
7-
---
8-
9-
## 🧪 Test Execution
10-
11-
By default, **unit tests**, **integration tests**, and **smoke tests** run on all PRs.
12-
13-
For additional testing, add one or more of these labels to your PR:
14-
15-
- `test-browserbase` - Run Browserbase integration tests (requires API credentials)
16-
- `test-performance` - Run performance and load tests
17-
- `test-llm` - Run LLM integration tests (requires API keys)
18-
- `test-e2e` - Run end-to-end workflow tests
19-
- `test-slow` - Run all slow-marked tests
20-
- `test-all` - Run the complete test suite (use sparingly)
21-
22-
**Note**: Label-triggered tests only run when the labels are applied to the PR, not on individual commits.

stagehand/handlers/extract_handler.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
from stagehand.a11y.utils import get_accessibility_tree
88
from stagehand.llm.inference import extract as extract_inference
99
from stagehand.metrics import StagehandFunctionName # Changed import location
10-
from stagehand.types import (
11-
DefaultExtractSchema,
12-
ExtractOptions,
13-
ExtractResult,
14-
)
10+
from stagehand.types import DefaultExtractSchema, ExtractOptions, ExtractResult
1511
from stagehand.utils import inject_urls, transform_url_strings_to_ids
1612

1713
T = TypeVar("T", bound=BaseModel)
@@ -153,15 +149,14 @@ async def extract(
153149
validated_model_instance = schema.model_validate(raw_data_dict)
154150
processed_data_payload = validated_model_instance # Payload is now the Pydantic model instance
155151
except Exception as e:
156-
schema_name = getattr(schema, "__name__", str(schema))
157152
self.logger.error(
158-
f"Failed to validate extracted data against schema {schema_name}: {e}. Keeping raw data dict in .data field."
153+
f"Failed to validate extracted data against schema {schema.__name__}: {e}. Keeping raw data dict in .data field."
159154
)
160155

161-
# Create ExtractResult object with extracted data as fields
162-
# Instead of trying to spread dict fields, always use the data field approach
163-
# This ensures result.data is properly set for the page.extract() method
164-
result = ExtractResult(data=processed_data_payload)
156+
# Create ExtractResult object
157+
result = ExtractResult(
158+
data=processed_data_payload,
159+
)
165160

166161
return result
167162

@@ -171,4 +166,4 @@ async def _extract_page_text(self) -> ExtractResult:
171166

172167
tree = await get_accessibility_tree(self.stagehand_page, self.logger)
173168
output_string = tree["simplified"]
174-
return ExtractResult(data={"extraction": output_string})
169+
return ExtractResult(data=output_string)

tests/integration/README.md

Lines changed: 0 additions & 319 deletions
This file was deleted.

0 commit comments

Comments
 (0)