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
Currently, the metadata.save_to_json function is meant to throw an error if you provide a filename that already exists. We did this so that users wouldn't accidentally overwrite existing metadata files.
However, this become an issue if you want to read from a file, update the metadata (to correct it), and then write it back to the same file.
ValueError: A file named 'metadata.json' already exists in this folder. Please specify a different filename.
Expected behavior
Allow users a parameter that bypasses this check. It should be off by default (maintaining status quo), but users could always toggle it to allow re-saving to the same file.
To keep consistency with AI connectors, we can call this parameter mode. Possible values are:
(default) 'write': The status quo. AKA write the metadata into a new file, and raise an error if the file already exists.
'overwite': Write the metadata into the file. If it already exists, re-write the file
Problem Description
Currently, the
metadata.save_to_json
function is meant to throw an error if you provide a filename that already exists. We did this so that users wouldn't accidentally overwrite existing metadata files.However, this become an issue if you want to read from a file, update the metadata (to correct it), and then write it back to the same file.
Expected behavior
Allow users a parameter that bypasses this check. It should be off by default (maintaining status quo), but users could always toggle it to allow re-saving to the same file.
To keep consistency with AI connectors, we can call this parameter
mode
. Possible values are:'write'
: The status quo. AKA write the metadata into a new file, and raise an error if the file already exists.'overwite'
: Write the metadata into the file. If it already exists, re-write the fileThe text was updated successfully, but these errors were encountered: