Skip to content

Fix issue with user defined functions#992

Merged
rylev merged 3 commits intoAzure:mainfrom
rylev:fix-udfs-cosmos
Aug 9, 2022
Merged

Fix issue with user defined functions#992
rylev merged 3 commits intoAzure:mainfrom
rylev:fix-udfs-cosmos

Conversation

@rylev
Copy link
Contributor

@rylev rylev commented Aug 9, 2022

Creating user defined functions was broken - this fixes that and makes a test for user defined functions using the mock framework.

The fix itself was twofold:

  • Using the right format for the date header. I actually think all of the cosmos crate is broken since we don't test dates in local tests since they change on every request. I believe this was an issue introduced by switch from chrono crate to time crate #965.
  • The resource type (which is used to sign the request) was not correct for user defined functions. There was one additional place where the resource type was incorrect - which I fixed. We're missing test coverage for stored procedures unfortunately.

Additionally, I made the following changes:

  • We currently only retry HTTP errors that are not on the disallow list and all other errors. This makes it such that only IO errors get retried. Generally speaking, any other type of error is something wrong that a retry won't fix, and it should be bubbled up to the user ASAP.
  • There were a few general headers that were duplicated across azure_core and azure_data_cosmos. I deleted the ones in cosmos and just used the ones from azure_core.

@rylev rylev requested review from cataggar and yoshuawuyts August 9, 2022 09:52

request.insert_header(HEADER_DATE, HeaderValue::from(time_nonce.to_string()));
request.insert_header(HEADER_VERSION, HeaderValue::from_static(AZURE_VERSION));
request.insert_header(MS_DATE, HeaderValue::from(date::to_rfc1123(&time_nonce)));
Copy link
Member

Choose a reason for hiding this comment

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

Yes, looks like this was missed in #965.

@rylev rylev merged commit e2ac5dd into Azure:main Aug 9, 2022
@rylev rylev deleted the fix-udfs-cosmos branch August 9, 2022 13:04
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

Comments