You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adds support for projects
1. if a project name is provided in pull_dataset or create_dataset*
methods, the dataset will be searched for or created under the specified
project
2. otherwise, the default project is used, or the project name from the
`LLMObs.enable` call or the env var is used
with this snippet
```
LLMObs.enable(api_key=os.getenv("DD_API_KEY"), app_key=os.getenv("DD_APPLICATION_KEY"), project_name="Onboarding", ml_app="Onboarding-ML-App")
dataset_name = "weatheraus-2025090900011"
dataset = LLMObs.create_dataset_from_csv(csv_path="/Users/gary.huang/Downloads/weatherAUS.csv", dataset_name=dataset_name, project_name="big-data-gh" , input_data_columns=["Date", "input", "Evaporation", "Sunshine"], expected_output_columns=["RainTomorrow"])
print(dataset.as_dataframe())
print(dataset.url)
time.sleep(30)
try:
pds = LLMObs.pull_dataset(dataset_name=dataset_name)
except Exception as e:
print(e)
pds = LLMObs.pull_dataset(dataset_name=dataset_name, project_name="big-data-gh")
print(pds.as_dataframe())
print(pds.url)
```
we get the following output
```
python test-project.py
3.15.0.dev13+gcb1068a93
input_data expected_output input_data
Date RainTomorrow Sunshine Evaporation input
0 2008-12-01 No NA NA Albury
1 2008-12-02 No NA NA Albury
2 2008-12-03 No NA NA Albury
3 2008-12-04 No NA NA Albury
4 2008-12-05 No NA NA Albury
... ... ... ... ... ...
145455 2017-06-21 No NA NA Uluru
145456 2017-06-22 No NA NA Uluru
145457 2017-06-23 No NA NA Uluru
145458 2017-06-24 No NA NA Uluru
145459 2017-06-25 NA NA NA Uluru
[145460 rows x 5 columns]
https://app.datadoghq.com/llm/datasets/7f81325e-dce1-49c7-b6bf-c75947490891
Dataset 'weatheraus-202509090928' not found in project Onboarding
input_data expected_output input_data
Date RainTomorrow Sunshine Evaporation input
0 2008-12-05 No NA NA Albury
1 2008-12-08 No NA NA Albury
2 2008-12-10 No NA NA Albury
3 2008-12-09 Yes NA NA Albury
4 2008-12-12 Yes NA NA Albury
... ... ... ... ... ...
145455 2016-08-25 No NA NA Uluru
145456 2016-11-20 No NA NA Uluru
145457 2016-12-26 Yes NA NA Uluru
145458 2016-12-31 No NA NA Uluru
145459 2017-04-29 No NA NA Uluru
[145460 rows x 5 columns]
https://app.datadoghq.com/llm/datasets/7f81325e-dce1-49c7-b6bf-c75947490891
```
the first pull hits an exception because the dataset wasn't found in the
default project from the enable call, and the 2nd pull succeeds, all as
expected
an alternate approach would be to initialize default project in
`enable`, but that messes with the tests everywhere that don't have
cassettes
## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))
## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
---------
Co-authored-by: Sam Brenner <[email protected]>
0 commit comments