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
It’s possible to provide a scheduled_execution_date in form of , and it works ok when provided value is an actual date but it falis when it only "looks like a date" i.e.: ”2024-1-0”.
In such cases we send it to the serverapi 'as is' and it result in a ‘Bad request’ response:
Traceback (most recent call last):
File "C:\Automation\STK\STKTests\jobqueue\jobqueue-smoke-test.py", line 252, in <module>
import_job = api_client.create_job_and_wait(job_request=import_request)
File "C:\Program Files\Python313\Lib\site-packages\ansys\grantami\jobqueue\_connection.py", line 354, in create_job_and_wait
job = self.create_job(job_request=job_request)
File "C:\Program Files\Python313\Lib\site-packages\ansys\grantami\jobqueue\_connection.py", line 398, in create_job
job_response = self.job_queue_api.create_job(body=job_request._get_job_for_submission())
File "C:\Program Files\Python313\Lib\site-packages\ansys\grantami\serverapi_openapi\api\job_queue_api.py", line 64, in create_job
data = self._create_job_with_http_info(body, _return_http_data_only=True)
File "C:\Program Files\Python313\Lib\site-packages\ansys\grantami\serverapi_openapi\api\job_queue_api.py", line 107, in _create_job_with_http_info
return self.api_client.call_api(
File "C:\Program Files\Python313\Lib\site-packages\ansys\openapi\common\_api_client.py", line 475, in call_api
return self.__call_api(
File "C:\Program Files\Python313\Lib\site-packages\ansys\openapi\common\_api_client.py", line 196, in __call_api
response_data = self.request(
File "C:\Program Files\Python313\Lib\site-packages\ansys\openapi\common\_api_client.py", line 563, in request
return handle_response(
File "C:\Program Files\Python313\Lib\site-packages\ansys\openapi\common\_util.py", line 380, in handle_response
raise ApiException.from_response(response)
ansys.openapi.common._exceptions.ApiException: ApiException(400, 'Bad Request')
HTTP response headers: {'Cache-Control': 'private', 'Content-Type': 'application/json; charset=utf-8', 'Server': 'Microsoft-IIS/10.0', 'Persistent-Auth': 'true', 'X-Frame-Options': 'SAMEORIGIN', 'X-Content-Type-Options': 'nosniff', 'Strict-Transport-Security': 'max-age=31536000', 'Date': 'Thu, 14 Nov 2024 12:23:03 GMT', 'Content-Length': '131'}
HTTP response body: {"scheduledExecutionDate":["Could not convert string to DateTime: 2024-1-0. Path 'scheduledExecutionDate', line 1, position 401."]}`
additionally:
“2024-1“ value results in “status: "JobStatus.Succeeded"“ (it shouldn't)
but
but ‘2024’ results in:
Traceback (most recent call last):
File "C:\Automation\STK\STKTests\jobqueue\jobqueue-smoke-test.py", line 252, in <module>
import_job = api_client.create_job_and_wait(job_request=import_request)
File "C:\Program Files\Python313\Lib\site-packages\ansys\grantami\jobqueue\_connection.py", line 354, in create_job_and_wait
job = self.create_job(job_request=job_request)
File "C:\Program Files\Python313\Lib\site-packages\ansys\grantami\jobqueue\_connection.py", line 398, in create_job
job_response = self.job_queue_api.create_job(body=job_request._get_job_for_submission())
File "C:\Program Files\Python313\Lib\site-packages\ansys\grantami\serverapi_openapi\api\job_queue_api.py", line 64, in create_job
data = self._create_job_with_http_info(body, _return_http_data_only=True)
File "C:\Program Files\Python313\Lib\site-packages\ansys\grantami\serverapi_openapi\api\job_queue_api.py", line 107, in _create_job_with_http_info
return self.api_client.call_api(
File "C:\Program Files\Python313\Lib\site-packages\ansys\openapi\common\_api_client.py", line 475, in call_api
return self.__call_api(
File "C:\Program Files\Python313\Lib\site-packages\ansys\openapi\common\_api_client.py", line 196, in __call_api
response_data = self.request(
File "C:\Program Files\Python313\Lib\site-packages\ansys\openapi\common\_api_client.py", line 563, in request
return handle_response(
File "C:\Program Files\Python313\Lib\site-packages\ansys\openapi\common\_util.py", line 380, in handle_response
raise ApiException.from_response(response)
ansys.openapi.common._exceptions.ApiException: ApiException(400, 'Bad Request')
HTTP response headers: {'Cache-Control': 'private', 'Content-Type': 'application/json; charset=utf-8', 'Server': 'Microsoft-IIS/10.0', 'Persistent-Auth': 'true', 'X-Frame-Options': 'SAMEORIGIN', 'X-Content-Type-Options': 'nosniff', 'Strict-Transport-Security': 'max-age=31536000', 'Date': 'Thu, 14 Nov 2024 12:30:17 GMT', 'Content-Length': '127'}
HTTP response body: {"scheduledExecutionDate":["Could not convert string to DateTime: 2024. Path 'scheduledExecutionDate', line 1, position 397."]}`
📝 Steps to reproduce
prepare ExcelImportJobRequest where one of files parameter is a path to a folder, and create a job with it
konradkudziagranta
changed the title
We don't check if string is provided as scheduled_execution_date is a genuine datetime
We don't check if string provided as scheduled_execution_date is a genuine datetime
Nov 14, 2024
🔍 Before submitting the issue
🐞 Description of the bug
It’s possible to provide a scheduled_execution_date in form of , and it works ok when provided value is an actual date but it falis when it only "looks like a date" i.e.: ”2024-1-0”.
In such cases we send it to the serverapi 'as is' and it result in a ‘Bad request’ response:
additionally:
“2024-1“ value results in “status: "JobStatus.Succeeded"“ (it shouldn't)
but
but ‘2024’ results in:
📝 Steps to reproduce
prepare ExcelImportJobRequest where one of files parameter is a path to a folder, and create a job with it
💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
ansys-grantami-jobqueue 1.1.0rc0
ansys-grantami-serverapi-openapi 4.0.0
ansys-openapi-common 2.2.0
GRANTA_MIScriptingToolkit 4.1.75
Granta MI b. 25.1.1888
🐍 Which Python version are you using?
3.13
📦 Installed packages
The text was updated successfully, but these errors were encountered: