Skip to content

Fix for single file native upload: directory path gets lost#53

Merged
JR-1991 merged 2 commits into
gdcc:mainfrom
bnavigator:fix-native-single-file-path
May 14, 2026
Merged

Fix for single file native upload: directory path gets lost#53
JR-1991 merged 2 commits into
gdcc:mainfrom
bnavigator:fix-native-single-file-path

Conversation

@bnavigator
Copy link
Copy Markdown
Contributor

When uploading a single file with a directory label, this gets lost in the native upload:

╭────────────── DVUploader ──────────────╮
│ Server: https://darus.uni-stuttgart.de │
│ PID: doi:10.18419/DARUS-6027           │
│ Files: 1                               │
╰────────────────────────────────────────╯
🔎 Checking dataset files
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓
┃ File                                                   ┃ Status ┃ Action ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━┩
│ SOF-DWG-MM-1260.0.00 R01 Reference Mirror Assembly.pdf │ New    │ Upload │
└────────────────────────────────────────────────────────┴────────┴────────┘

⚠  Direct upload not supported. Falling back to Native API.

🚀 Uploading files

DEBUG: file=File(filepath='ta-library/1000 Optical Assembly/1200 Secondary Mirror Assembly/1260 SM Reference Mirror SMRM/_DWG/SOF-DWG-MM-1260.0.00 R01 Reference Mirror
Assembly.pdf', handler=None, description='SOF-DWG-MM-1260.0.00, Document Iteration No. 1 (Max: 1)', directory_label='1000 Optical Assembly/1200 Secondary Mirror Assembly/1260 SM
Reference Mirror SMRM/_DWG', mimeType='application/octet-stream', categories=['Lifecycle State: Released', 'TA Level 1: OA', 'TA Level 0: TA', 'TA Level 3: SMRM', 'Drawing', 'TA
Level 2: SMA', 'Company: Astrium', 'Document Iteration: Most Recent'], restrict=True, checksum_type=<ChecksumTypes.MD5: ('MD5', <built-in function openssl_md5>)>,
storageIdentifier=None, file_name='SOF-DWG-MM-1260.0.00 R01 Reference Mirror Assembly.pdf', checksum=Checksum(type='MD5', value=None), file_id=None, tab_ingest=True,
to_replace=False)
DEBUG: json_data={'description': 'SOF-DWG-MM-1260.0.00, Document Iteration No. 1 (Max: 1)', 'categories': ['Lifecycle State: Released', 'TA Level 1: OA', 'TA Level 0: TA', 'TA Level
3: SMRM', 'Drawing', 'TA Level 2: SMA', 'Company: Astrium', 'Document Iteration: Most Recent'], 'restrict': True}
(
    'File 1000 Optical Assembly/1200 Secondary Mirror Assembly/1260 SM Reference Mirror SMRM/_DWG/SOF-DWG-MM-1260.0.00 R01 Reference Mirror Assembly.pdf not found in Dataverse
repository.',
    'This may be due to the file not being uploaded to the repository:'
)
SOF-DWG-MM-1260.0.00 R01 Reference Mirror Assembly.pdf ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00

✅ Upload complete

@bnavigator bnavigator changed the title Add test for single file upload Fix for single file native upload: directory path gets lost May 13, 2026
@bnavigator bnavigator force-pushed the fix-native-single-file-path branch from 95876ff to 024d192 Compare May 13, 2026 14:03
@bnavigator bnavigator force-pushed the fix-native-single-file-path branch from 024d192 to 36bb022 Compare May 13, 2026 14:15
@bnavigator bnavigator marked this pull request as ready for review May 13, 2026 15:07
Copy link
Copy Markdown
Member

@JR-1991 JR-1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnavigator thanks for the PR! Tested it locally and it works perfect. Code looks great as well. Merging!

@JR-1991 JR-1991 merged commit 0f6e378 into gdcc:main May 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants