Commit 3fd505b
authored
[OPIK-4961] [OPIK-5207] [P SDK] [M2] Python SDK: Add project_name parameter to dataset, prompt, and experiment methods (#5684)
* [OPIK-4961] Add `project_name` field to `Dataset` and update related tests
- Introduced the `project_name` field in the `Dataset` class to associate datasets with specific projects.
- Updated dataset initialization in tests and CLI to include the new `project_name` parameter when creating datasets.
- Added a corresponding `project_name` property with getter functionality in the `Dataset` class.
* [OPIK-4961] Add `project_name` support across SDK modules and update related tests
- Introduced the `project_name` parameter throughout SDK methods for dataset, experiment, evaluation suite, and prompt operations.
- Updated retrieval, creation, and search functions to handle `project_name` correctly.
- Added missing TODO comments to integrate `project_name` with the backend when applicable.
- Synchronized test cases to validate new `project_name` behavior.
* [OPIK-4961] Refactor `project_name` handling in dataset and experiment methods
- Adjusted method parameter order to make `project_name` optional and consistent with SDK conventions.
- Added `project_name` resolution logic for improved dataset ID retrieval.
* [OPIK-4961] Updated Fern code
* [OPIK-4961] Updated Fern code
* [OPIK-4961] Add `project_name` support to `delete_dataset` and dataset streaming methods
- Updated `delete_dataset` to accept an optional `project_name` parameter, with default resolution logic.
- Extended dataset streaming and related classes to handle `project_name`.
- Added unit tests to validate `project_name` behavior in `delete_dataset`.
* [OPIK-4961] Add `project_name` support to prompt creation, retrieval, and search methods
- Updated prompt creation, retrieval, and history functions (`create_prompt`, `get_prompt`, `get_prompt_history`) to include `project_name` handling.
- Extended ChatPrompt methods with `project_name` support.
- Refactored relevant classes and tests to validate `project_name` resolution and propagation.
* [OPIK-4961] Extend `project_name` support to chat prompts and update relevant tests
- Added `project_name` parameter to chat prompt creation, retrieval, search, and history methods (`create_chat_prompt`, `get_chat_prompt`, `get_chat_prompt_history`, `search_prompts`).
- Updated chat prompt-related tests to validate `project_name` propagation.
- Fixed typos in code examples for `get_prompt_history` and `get_chat_prompt_history`.
* [OPIK-4961] Add `project_name` support to dataset creation, filtering, and version view methods
- Updated dataset creation, filtering, and version view methods (`create_dataset`, `get_items`, `get_version_view`) to include `project_name` handling.
- Extended E2E tests to validate `project_name` propagation and expected behavior.
- Added assertions for `project_name` comparison in dataset verifications.
* [OPIK-4961] Expand `project_name` support across evaluation suites, experiments, and verifiers
- Added `project_name` handling to evaluation suite creation, retrieval, and propagation methods.
- Updated experiments, verifiers, and rest operations to support `project_name`.
- Enhanced E2E tests to validate `project_name` propagation and assertions within evaluation scenarios.
* [OPIK-4961] Add `project_name` parameter to evaluation test cases
- Updated various unit tests to include `project_name` in evaluation suite, experiment, and dataset setups.
- Added mock `project_name` initialization for dataset tests to ensure proper test coverage.
* [OPIK-4961] Add `project_name` to evaluation and prompt test cases
- Incorporated `project_name` parameter across evaluation and prompt test suites.
- Updated test cases to validate `project_name` propagation for datasets, experiments, and prompts.
- Enhanced verifications and assertions to include `project_name` consistency checks.
* [OPIK-4961] Add `project_name` to `stream_experiments` in REST operations
- Updated `rest_operations.stream_experiments` to include `project_name` parameter.
- Ensured proper propagation of `project_name` to REST client calls.
* [OPIK-4961] Resolved merge conflicts and updated
* [OPIK-4961] Resolved merge conflicts and updated
* [OPIK-4961] Fixed flacky tests
* [OPIK-4961] Remove unused `_resolve_project_id` method from `opik_client`
* [OPIK-4961] Update test cases to include `project_name` in experiment and suite retrievals
- Added `project_name` parameter to experiment and evaluation suite retrievals in test cases.
- Ensured consistency of verifications and assertions with `project_name` usage.
* [OPIK-4961] Implemented backward compatibility E2E tests for OPIK v1.x
- Set default value for the `project_name` parameter to `None` in dataset verification utility.
- Introduced extensive compatibility tests for evaluation APIs, covering dataset versioning, assertions, execution policies, and pass/fail logic.
- Enhanced validation checks for persistence, retrieval, and consistency of evaluation suite configurations.
* [OPIK-4961] Fixed prompts test to avoid flakiness
* [OPIK-4961] Add Python SDK Compatibility V1.x E2E tests
- Introduced a new GitHub Actions workflow for Python SDK Compatibility V1.x End-to-End tests.
- Updated existing E2E test workflow to ignore compatibility V1 tests.
* [OPIK-4961] Remove default value for `project_name` in `get_experiment_with_unique_name` function1 parent 4c4a8e3 commit 3fd505b
File tree
49 files changed
+7440
-216
lines changed- .github/workflows
- sdks/python
- src/opik
- api_objects
- dataset
- evaluation_suite
- experiment
- prompt
- chat
- text
- cli/exports
- evaluation
- tests
- e2e
- compatibility_v1
- evaluation
- evaluation
- unit
- api_objects
- dataset
- evaluation_suite
- evaluation
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+7440
-216
lines changedLines changed: 116 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
| |||
264 | 271 | | |
265 | 272 | | |
266 | 273 | | |
| 274 | + | |
267 | 275 | | |
268 | 276 | | |
269 | 277 | | |
| |||
313 | 321 | | |
314 | 322 | | |
315 | 323 | | |
| 324 | + | |
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
| |||
323 | 332 | | |
324 | 333 | | |
325 | 334 | | |
| 335 | + | |
326 | 336 | | |
327 | 337 | | |
328 | 338 | | |
| |||
331 | 341 | | |
332 | 342 | | |
333 | 343 | | |
334 | | - | |
| 344 | + | |
335 | 345 | | |
336 | 346 | | |
337 | 347 | | |
338 | 348 | | |
339 | 349 | | |
340 | 350 | | |
341 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
342 | 357 | | |
343 | 358 | | |
344 | 359 | | |
| |||
353 | 368 | | |
354 | 369 | | |
355 | 370 | | |
356 | | - | |
| 371 | + | |
357 | 372 | | |
358 | 373 | | |
359 | 374 | | |
| |||
479 | 494 | | |
480 | 495 | | |
481 | 496 | | |
482 | | - | |
| 497 | + | |
483 | 498 | | |
484 | 499 | | |
485 | 500 | | |
| |||
712 | 727 | | |
713 | 728 | | |
714 | 729 | | |
| 730 | + | |
715 | 731 | | |
716 | 732 | | |
717 | 733 | | |
| |||
825 | 841 | | |
826 | 842 | | |
827 | 843 | | |
| 844 | + | |
828 | 845 | | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
| |||
437 | 442 | | |
438 | 443 | | |
439 | 444 | | |
| 445 | + | |
440 | 446 | | |
441 | 447 | | |
442 | 448 | | |
| |||
Lines changed: 29 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
173 | 176 | | |
174 | 177 | | |
175 | 178 | | |
176 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
180 | | - | |
181 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
182 | 192 | | |
183 | 193 | | |
184 | 194 | | |
185 | 195 | | |
| 196 | + | |
186 | 197 | | |
187 | 198 | | |
188 | 199 | | |
| |||
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
| 206 | + | |
195 | 207 | | |
196 | 208 | | |
197 | 209 | | |
| |||
206 | 218 | | |
207 | 219 | | |
208 | 220 | | |
209 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
210 | 224 | | |
211 | 225 | | |
212 | | - | |
| 226 | + | |
213 | 227 | | |
214 | 228 | | |
215 | 229 | | |
| |||
263 | 277 | | |
264 | 278 | | |
265 | 279 | | |
| 280 | + | |
266 | 281 | | |
267 | 282 | | |
268 | 283 | | |
| |||
275 | 290 | | |
276 | 291 | | |
277 | 292 | | |
| 293 | + | |
278 | 294 | | |
279 | 295 | | |
280 | 296 | | |
| 297 | + | |
281 | 298 | | |
282 | 299 | | |
283 | 300 | | |
284 | 301 | | |
285 | 302 | | |
286 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
287 | 308 | | |
288 | 309 | | |
289 | 310 | | |
290 | | - | |
| 311 | + | |
| 312 | + | |
291 | 313 | | |
292 | 314 | | |
293 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| 143 | + | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
| |||
0 commit comments