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
2 changes: 1 addition & 1 deletion DataFileUtil.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions DataFileUtil.spec
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ module DataFileUtil {
Save objects to the workspace.

The objects will be sorted prior to saving to avoid the Workspace sort memory limit.
Note that workspace object refs in the object may cause the Workspace to resort the data
unless they are already in UPA format (e.g. #/#/#), so it is strongly recommended to
convert object refs to UPAs.
Note that if the object contains workspace object refs in mapping keys that may cause
the Workspace to resort the data. To avoid this, convert any refs in mapping keys to UPA
format (e.g. #/#/#, where # is a positive integer).

If the data is very large, using the WSLargeDataIO SDK module is advised.

Expand Down
24 changes: 13 additions & 11 deletions lib/DataFileUtil/DataFileUtilClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,13 @@ def ws_name_to_id(self, name, context=None):

def save_objects(self, params, context=None):
"""
Save objects to the workspace. Saving over a deleted object undeletes
it.
Save objects to the workspace.
The objects will be sorted prior to saving to avoid the Workspace sort memory limit.
Note that if the object contains workspace object refs in mapping keys that may cause
the Workspace to resort the data. To avoid this, convert any refs in mapping keys to UPA
format (e.g. #/#/#, where # is a positive integer).
If the data is very large, using the WSLargeDataIO SDK module is advised.
Saving over a deleted object undeletes it.
:param params: instance of type "SaveObjectsParams" (Input parameters
for the "save_objects" function. Required parameters: id - the
numerical ID of the workspace. objects - the objects to save. The
Expand All @@ -367,15 +372,12 @@ def save_objects(self, params, context=None):
type "ObjectSaveData" (An object and associated data required for
saving. Required parameters: type - the workspace type string for
the object. Omit the version information to use the latest
version. data - the object data. Optional parameters: One of an
object name or id. If no name or id is provided the name will be
set to 'auto' with the object id appended as a string, possibly
with -\d+ appended if that object id already exists as a name.
name - the name of the object. objid - the id of the object to
save over. meta - arbitrary user-supplied metadata for the object,
not to exceed 16kb; if the object type specifies automatic
metadata extraction with the 'meta ws' annotation, and your
metadata name conflicts, then your metadata will be silently
version. data - the object data. One of an object name or id: name
- the name of the object. objid - the id of the object to save
over. Optional parameters: meta - arbitrary user-supplied metadata
for the object, not to exceed 16kb; if the object type specifies
automatic metadata extraction with the 'meta ws' annotation, and
your metadata name conflicts, then your metadata will be silently
overwritten. hidden - true if this object should not be listed
when listing workspace objects. extra_provenance_input_refs -
(optional) if set, these refs will be appended to the primary
Expand Down
30 changes: 16 additions & 14 deletions lib/DataFileUtil/DataFileUtilImpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ class DataFileUtil:
# state. A method could easily clobber the state set by another while
# the latter method is running.
######################################### noqa
VERSION = "0.1.2"
GIT_URL = "git@github.com:kbaseapps/DataFileUtil.git"
GIT_COMMIT_HASH = "d8091ef8acdee21c5b43d1b84d3983b04be3729e"
VERSION = "0.1.3"
GIT_URL = "https://github.com/kbaseapps/DataFileUtil.git"
GIT_COMMIT_HASH = "df19d64a4a70c6ab32d6248a216bc25be0ac35ba"

#BEGIN_CLASS_HEADER

Expand Down Expand Up @@ -1294,8 +1294,13 @@ def ws_name_to_id(self, ctx, name):

def save_objects(self, ctx, params):
"""
Save objects to the workspace. Saving over a deleted object undeletes
it.
Save objects to the workspace.
The objects will be sorted prior to saving to avoid the Workspace sort memory limit.
Note that if the object contains workspace object refs in mapping keys that may cause
the Workspace to resort the data. To avoid this, convert any refs in mapping keys to UPA
format (e.g. #/#/#, where # is a positive integer).
If the data is very large, using the WSLargeDataIO SDK module is advised.
Saving over a deleted object undeletes it.
:param params: instance of type "SaveObjectsParams" (Input parameters
for the "save_objects" function. Required parameters: id - the
numerical ID of the workspace. objects - the objects to save. The
Expand All @@ -1304,15 +1309,12 @@ def save_objects(self, ctx, params):
type "ObjectSaveData" (An object and associated data required for
saving. Required parameters: type - the workspace type string for
the object. Omit the version information to use the latest
version. data - the object data. Optional parameters: One of an
object name or id. If no name or id is provided the name will be
set to 'auto' with the object id appended as a string, possibly
with -\d+ appended if that object id already exists as a name.
name - the name of the object. objid - the id of the object to
save over. meta - arbitrary user-supplied metadata for the object,
not to exceed 16kb; if the object type specifies automatic
metadata extraction with the 'meta ws' annotation, and your
metadata name conflicts, then your metadata will be silently
version. data - the object data. One of an object name or id: name
- the name of the object. objid - the id of the object to save
over. Optional parameters: meta - arbitrary user-supplied metadata
for the object, not to exceed 16kb; if the object type specifies
automatic metadata extraction with the 'meta ws' annotation, and
your metadata name conflicts, then your metadata will be silently
overwritten. hidden - true if this object should not be listed
when listing workspace objects. extra_provenance_input_refs -
(optional) if set, these refs will be appended to the primary
Expand Down