Skip to content

Commit 269c8d1

Browse files
committed
fixed org_id
1 parent 1aa3a65 commit 269c8d1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

singlestoredb/ml/ml_train.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,9 @@ def __init__(
115115
jwt_token: Optional[str] = None,
116116
base_url: str = "https://api.singlestore.com/v1",
117117
):
118-
token = jwt_token or "09f75c43e5ed6ceb1cdf34ea35ced436599450967e3772a34f774f4f36a49945"
119-
# token = jwt_token or os.environ.get("SINGLESTOREDB_USER_TOKEN")
118+
token = jwt_token or os.environ.get("SINGLESTOREDB_USER_TOKEN")
120119
# token = jwt_token or os.environ.get("SINGLESTOREDB_APP_TOKEN")
121120

122-
123121
if not token:
124122
raise ValueError("Set your JWT in SINGLESTORE_JWT or pass it in.")
125123
self.base_url = base_url.rstrip("/")
@@ -130,6 +128,8 @@ def __init__(
130128
"Accept": "application/json",
131129
})
132130

131+
132+
133133
def list_jobs(self) -> List[Dict[str, Any]]:
134134
"""Fetch all jobs; filter client‑side by name."""
135135
url = f"{self.base_url}/jobs"
@@ -167,7 +167,10 @@ def create_job(
167167
},
168168
"targetConfig": target_config,
169169
}
170-
url = f"{self.base_url}/jobs"
170+
org_id = os.environ.get("SINGLESTOREDB_ORG_ID")
171+
if not org_id:
172+
raise ValueError("Please set SINGLESTOREDB_ORG_ID in your env.")
173+
url = f"{self.base_url}/jobs?organizationID={org_id}"
171174
resp = self.session.post(url, json=payload)
172175
if not resp.ok:
173176
raise SingleStoreAPIError(resp.status_code, resp.text, resp)

0 commit comments

Comments
 (0)