modelPublishing copyModelExternal

Edge Case: Invalid Configuration for Filesystem Export

Scénario de test & Cas d'usage

Business Context

An R&D engineer is attempting to archive an experimental model to a local filesystem for offline analysis. They are unfamiliar with the API and omit the mandatory directory path, allowing us to test the robustness of parameter validation.
Data Preparation

Train a simple dummy model for quick iteration.

Copied!
1 
2DATA casuser.dummy;
3x=1;
4y=1;
5OUTPUT;
6 
7RUN;
8 
9PROC CAS;
10LOADACTIONSET 'regression';
11regression.glm / TABLE='dummy' target='y' inputs={'x'} store={name='dummy_reg', replace=true};
12LOADACTIONSET 'aStore';
13aStore.save / rstore={name='dummy_reg'} TABLE={name='archive_table', replace=true};
14 
15RUN;
16 

Étapes de réalisation

1
Attempt to copy to FILESYSTEM without specifying the 'modelDir' parameter.
Copied!
1 
2PROC CAS;
3modelPublishing.copyModelExternal / modelTable={name='archive_table', caslib='casuser'} modelName='dummy_reg' externalCaslib='fs_repo' externalOptions={extType='FILESYSTEM'};
4/* Missing modelDir */
5RUN;
6 
2
Attempt to copy without specifying the 'modelName' parameter.
Copied!
1 
2PROC CAS;
3modelPublishing.copyModelExternal / modelTable={name='archive_table', caslib='casuser'} externalCaslib='fs_repo' externalOptions={extType='FILESYSTEM', modelDir='/tmp/models'};
4/* Missing modelName */
5RUN;
6 

Expected Result


The action should fail gracefully in both steps. Step 1 must return an error indicating that 'modelDir' is required for FILESYSTEM type. Step 2 must return an error stating that 'modelName' is a required parameter. The system should not crash.