Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ Changelog
==========


14.2.2 (2025-11-14)
-------------------

* Initial release for DSS 14.2.2

14.2.1 (2025-10-30)
-------------------

Expand Down
3 changes: 2 additions & 1 deletion dataikuapi/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def _perform_http(self, method, path, params=None, body=None, stream=False):
http_res = self._session.request(
method, "%s/%s" % (self.base_uri, path),
params=params, data=body, headers=headers,
auth=auth, stream = stream)
auth=auth, stream = stream,
verify=self._session.verify)
handle_http_exception(http_res)
return http_res

Expand Down
2 changes: 1 addition & 1 deletion dataikuapi/dss/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def __init__(self, preferences):
@property
def ui_language(self):
"""
Get or set the language used in the Web User Interface for this user. Valid values are "en" (English) and "ja" (Japanese)
Get or set the language used in the Web User Interface for this user. Valid values are "en" (English), "ja" (Japanese) and "fr" (French).

:rtype: str
"""
Expand Down
6 changes: 3 additions & 3 deletions dataikuapi/dss/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ def generate_ai_description(self, language="english", save_description=False):
Generates AI-powered descriptions for this dataset and its columns.

This function operates with a two-tier rate limit per license:
1. Up to 1000 requests per day.
2. **Throttled Mode:** After the daily limit, the API's response time is slowed.
Each subsequent call will take approximately 60 seconds to process and return a response.
1. Up to 1000 requests per day.
2. **Throttled Mode:** After the daily limit, the API's response time is slowed.
Each subsequent call will take approximately 60 seconds to process and return a response.

Note: The "Generate Metadata" option must be enabled in the AI Services admin settings.

Expand Down
6 changes: 3 additions & 3 deletions dataikuapi/dss/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,9 @@ def generate_ai_description(self, language="english", purpose="generic", length=
Generates an AI-powered description for this flow zone.

This function operates with a two-tier rate limit per license:
1. Up to 1000 requests per day.
2. **Throttled Mode:** After the daily limit, the API's response time is slowed.
Each subsequent call will take approximately 60 seconds to process and return a response.
1. Up to 1000 requests per day.
2. **Throttled Mode:** After the daily limit, the API's response time is slowed.
Each subsequent call will take approximately 60 seconds to process and return a response.

Note: The "Generate Metadata" option must be enabled in the AI Services admin settings.

Expand Down
49 changes: 43 additions & 6 deletions dataikuapi/dss/knowledgebank.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
import logging

from .document_extractor import ManagedFolderImageRef
from .document_extractor import ManagedFolderImageRef, ManagedFolderDocumentRef
from .managedfolder import DSSManagedFolder
from .utils import DSSTaggableObjectListItem, DSSTaggableObjectSettings
from .utils import DSSTaggableObjectListItem, DSSTaggableObjectSettings, AnyLoc

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -185,9 +185,9 @@ def search(self, query,
"useAdvancedReranking": hybrid_use_advanced_reranking,
"rrfRankConstant": hybrid_rrf_rank_constant,
"rrfRankWindowSize": hybrid_rrf_rank_window_size,
"allMetadataInContext": True,
"includeScore": True,
"filter": {}
"filter": {},
"includeMultimodalContent": True
})
})
if response.get("error"):
Expand Down Expand Up @@ -372,7 +372,10 @@ def metadata(self):
:return: metadata for this document
:rtype: dict
"""
return self._metadata
return {
key: value for key, value in self._metadata.items()
if key not in {'DKU_MULTIMODAL_CONTENT', 'DKU_DOCUMENT_INFO'}
}

@property
def images(self):
Expand All @@ -382,7 +385,7 @@ def images(self):
:return: a list of images references or None
:rtype: list[ManagedFolderImageRef] | None
"""
multimodal_raw = self.metadata.get("DKU_MULTIMODAL_CONTENT")
multimodal_raw = self._metadata.get("DKU_MULTIMODAL_CONTENT")
if not multimodal_raw:
return None
try:
Expand All @@ -397,3 +400,37 @@ def images(self):
return [
ManagedFolderImageRef(self._result.managed_folder_id, path) for path in multimodal["content"]
]

@property
def file_ref(self):
"""
Returns the file reference for this document

:return: a file reference or None
:rtype: ManagedFolderDocumentRef | None
"""
document_info_raw = self._metadata.get("DKU_DOCUMENT_INFO")
if not document_info_raw:
return None
try:
document_info = json.loads(document_info_raw)
except ValueError as e:
logger.error("Failed to decode JSON payload for document info: {}, {}".format(e, document_info_raw))
return None

source_file_info = document_info.get("source_file")
if source_file_info is None:
return None

folder_full_id = source_file_info.get("folder_full_id")
path = source_file_info.get("path")
if folder_full_id is None or path is None:
return None

try:
folder_loc = AnyLoc.from_full(folder_full_id)
except ValueError as e:
logger.error("Invalid folder_full_id in DKU_DOCUMENT_INFO: {}, {}".format(e, document_info))
return None

return ManagedFolderDocumentRef(path, folder_loc.object_id)
6 changes: 3 additions & 3 deletions dataikuapi/dss/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ def generate_ai_description(self, language="english", purpose="generic", length=
Generates an AI-powered description for this project.

This function operates with a two-tier rate limit per license:
1. Up to 1000 requests per day.
2. **Throttled Mode:** After the daily limit, the API's response time is slowed.
Each subsequent call will take approximately 60 seconds to process and return a response.
1. Up to 1000 requests per day.
2. **Throttled Mode:** After the daily limit, the API's response time is slowed.
Each subsequent call will take approximately 60 seconds to process and return a response.

Note: The "Generate Metadata" option must be enabled in the AI Services admin settings.

Expand Down
44 changes: 26 additions & 18 deletions dataikuapi/dssclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ def list_project_keys(self):
"""
return [x["projectKey"] for x in self._perform_json("GET", "/projects/")]

def list_projects(self):
def list_projects(self, include_location=False):
"""
List the projects

:param bool include_location: whether to include project locations (slower)
:returns: a list of projects, each as a dict. Each dictcontains at least a 'projectKey' field
:rtype: list of dicts
"""
return self._perform_json("GET", "/projects/")
return self._perform_json("GET", "/projects/", params={"includeLocation": include_location})

def get_project(self, project_key):
"""
Expand Down Expand Up @@ -468,6 +469,7 @@ def create_user(self, login, password, display_name='', source_type='LOCAL', gro
Create a user, and return a handle to interact with it

Note: this call requires an API key with admin rights

Note: this call is not available to Dataiku Cloud users

:param str login: the login of the new user
Expand Down Expand Up @@ -499,10 +501,11 @@ def create_users(self, users):
Create multiple users, and return a list of creation status

Note: this call requires an API key with admin rights

Note: this call is not available to Dataiku Cloud users

:param list users: a list of dictionaries where each dictionary contains the parameters for user creation
It should contain the following keys:
:param list users: a list of dictionaries where each dictionary contains the parameters for user creation. It should contain the following keys:

- 'login' (str): the login of the new user
- 'password' (str): the password of the new user
- 'displayName' (str): the displayed name for the new user
Expand All @@ -512,8 +515,8 @@ def create_users(self, users):
- 'email' (str): The email for the new user. Defaults to None

:rtype: list[dict]
:return: A list of dictionaries, where each dictionary represents the creation status of a user.
It should contain the following keys:
:return: A list of dictionaries, where each dictionary represents the creation status of a user. It should contain the following keys:

- 'login' (str): the login of the created user
- 'status' (str): the creation status of the user. Can be 'SUCCESS' or 'FAILURE'
- 'error' (str): the error that occurred during that user's creation. Empty if status is not 'FAILURE'.
Expand Down Expand Up @@ -542,15 +545,16 @@ def edit_users(self, user_changes):
modify them and use this method to apply the modifications.

Note: This call requires an API key with admin rights.

Note: this call is not available to Dataiku Cloud users

:param list[dict] user_changes: A list of dictionaries, where each dictionary defines the
changes for a single user. Each dictionary **must** contain the
'login' key to identify the user. Other keys can be included
to modify the user's properties, matching the structure of a
user settings object (see the output of `list_users(include_settings=True))`.
user settings object (see the output of
`list_users(include_settings=True))`. Available keys include:

Available keys include:
- 'login' (str): The login of the user to modify (mandatory). Cannot be modified.
- 'displayName' (str): The user's display name.
- 'email' (str): The user's email address.
Expand All @@ -562,7 +566,8 @@ def edit_users(self, user_changes):
- 'userProperties' (dict): Custom user properties for the user.
- 'secrets' (list): A list of user-specific secrets.
- 'preferences' (dict): A dictionary of user preferences:
- 'uiLanguage' (str): UI language code (e.g., 'en', 'ja').

- 'uiLanguage' (str): UI language code (e.g., 'en', 'ja', 'fr').
- 'mentionEmails' (bool): Email notifications for mentions.
- 'discussionEmails' (bool): Email notifications for discussions.
- 'accessRequestEmails' (bool): Email notifications for access requests.
Expand All @@ -586,8 +591,8 @@ def edit_users(self, user_changes):
- 'scenarioRunNotifications' (bool): Notifications for scenario runs.

:rtype: list[dict]
:return: A list of dictionaries, one for each attempted modification, indicating the status.
Each dictionary contains the following keys:
:return: A list of dictionaries, one for each attempted modification, indicating the status. Each dictionary contains the following keys:

- 'login' (str): The login of the user that was modified.
- 'status' (str): The result of the operation, either 'SUCCESS' or 'FAILURE'.
- 'error' (str): The error message if the status is 'FAILURE', otherwise empty.
Expand All @@ -602,15 +607,15 @@ def delete_users(self, user_logins, allow_self_deletion=False):
Bulk deletes multiple users.

Note: This call requires an API key with admin rights.

Note: this call is not available to Dataiku Cloud users

:param list[str] user_logins : A list of logins for the users to be deleted.
:param bool allow_self_deletion : Allow the use of this function to delete your own user.
Warning: this is very dangerous and used recklessly could lead to the deletion of all users/admins.
:param list[str] user_logins: A list of logins for the users to be deleted.
:param bool allow_self_deletion: Allow the use of this function to delete your own user. Warning: this is very dangerous and used recklessly could lead to the deletion of all users/admins.

:rtype: list[dict]
:return: A list of dictionaries, one for each attempted deletion, indicating the status.
Each dictionary contains the following keys:
:return: A list of dictionaries, one for each attempted deletion, indicating the status. Each dictionary contains the following keys:

- 'login' (str): The login of the user that was deleted.
- 'status' (str): The result of the deletion, either 'SUCCESS' or 'FAILURE'.
- 'error' (str): The error message if the status is 'FAILURE', otherwise empty.
Expand All @@ -625,6 +630,7 @@ def delete_users(self, user_logins, allow_self_deletion=False):
def get_own_user(self):
"""
Get a handle to interact with the current user

:return: A :class:`dataikuapi.dss.admin.DSSOwnUser` user handle
"""
return DSSOwnUser(self)
Expand Down Expand Up @@ -1745,7 +1751,8 @@ def _perform_http(self, method, path, params=None, body=None, stream=False, file
params=params, data=body,
files=files,
stream=stream,
headers=headers)
headers=headers,
verify=self._session.verify)
handle_http_exception(http_res)
return http_res

Expand All @@ -1764,7 +1771,8 @@ def _perform_raw(self, method, path, params=None, body=None,files=None, raw_body
def _perform_json_upload(self, method, path, name, f):
http_res = self._session.request(
method, "%s/dip/publicapi%s" % (self.host, path),
files = {'file': (name, f, {'Expires': '0'})} )
files = {'file': (name, f, {'Expires': '0'})},
verify=self._session.verify)

handle_http_exception(http_res)
return http_res
Expand Down
1 change: 1 addition & 0 deletions dataikuapi/fmclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def _perform_http(
data=body,
files=files,
stream=stream,
verify=self._session.verify
)
handle_http_exception(http_res)
return http_res
Expand Down
Loading