-
Notifications
You must be signed in to change notification settings - Fork 2
DC-3567 Add PUT data/{provider}/{dataset}/{id}/ to DataApiV1Sdk
#64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
oleksii-symon-corva-ai
merged 24 commits into
feature/api20
from
feature/dc-3567_add-replace-document-to-data-sdk
Jun 7, 2022
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
90f774e
Do not add suffixes to urls in `UserApiSdk`
oleksii-symon-corva-ai 2a57c8f
Added default `logger` value
oleksii-symon-corva-ai 3e1b799
Added TestUserApiSdk.test_get
oleksii-symon-corva-ai 0e7b979
Use `coverage` instead of `test` in `all` target
oleksii-symon-corva-ai c73978d
Increased code coverage
oleksii-symon-corva-ai 6b2809f
Added env vars for integration tests to `test` step
oleksii-symon-corva-ai 3392040
Fix CI
oleksii-symon-corva-ai 3f91e44
Deleted env vars from `test` step
oleksii-symon-corva-ai 0401187
Raise for status immediately
oleksii-symon-corva-ai 50e9328
Added DataApiV1Sdk.insert
oleksii-symon-corva-ai a18242a
Fixed docstr
oleksii-symon-corva-ai f043c07
Rollback Makefile changes
oleksii-symon-corva-ai 60d9a1c
Set env variables inline in `integration-tests`
oleksii-symon-corva-ai 2801cd6
Merge branch 'feature/dc-3562_add-find-data' into feature/dc-3564_add…
oleksii-symon-corva-ai 136bbb2
Added `DataApiV1Sdk.replace` method
oleksii-symon-corva-ai 56773e1
Added `InsertResult` to `DataApiV1Sdk.insert`
oleksii-symon-corva-ai 1b85b09
Merge branch 'feature/dc-3564_add-post-documents' into feature/dc-356…
oleksii-symon-corva-ai 0a0ee5e
Deleted debug logging in tests
oleksii-symon-corva-ai 4b5e6d3
Merge branch 'feature/api20' into feature/dc-3564_add-post-documents
oleksii-symon-corva-ai 5d5c0ab
Merge branch 'feature/dc-3564_add-post-documents' into feature/dc-356…
oleksii-symon-corva-ai ab049d3
Regenerated test_insert.yaml with generic app name and dataset
oleksii-symon-corva-ai 940d6e2
Merge branch 'feature/dc-3564_add-post-documents' into feature/dc-356…
oleksii-symon-corva-ai 3220624
Regenerated test_replace.yaml with generic app name and dataset
oleksii-symon-corva-ai 088225a
Merge branch 'feature/api20' into feature/dc-3567_add-replace-documen…
oleksii-symon-corva-ai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
320 changes: 320 additions & 0 deletions
320
tests/integration/cassettes/TestUserApiSdk.test_replace.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,320 @@ | ||
| interactions: | ||
| - request: | ||
| body: '{"well": {"name": "deleteme-python-sdk-autotest-d4a1214c"}}' | ||
| headers: | ||
| accept: | ||
| - '*/*' | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| connection: | ||
| - keep-alive | ||
| content-length: | ||
| - '59' | ||
| content-type: | ||
| - application/json | ||
| user-agent: | ||
| - python-httpx/0.22.0 | ||
| method: POST | ||
| uri: null | ||
| response: | ||
| content: '{"data":{"id":"328568","type":"well","attributes":{"name":"deleteme-python-sdk-autotest-d4a1214c","status":"unknown","state":"planned"},"relationships":{}}}' | ||
| headers: | ||
| Cache-Control: | ||
| - max-age=0, private, must-revalidate | ||
| Connection: | ||
| - keep-alive | ||
| Content-Encoding: | ||
| - gzip | ||
| Content-Type: | ||
| - application/json; charset=utf-8 | ||
| Date: | ||
| - Mon, 23 May 2022 11:41:15 GMT | ||
| ETag: | ||
| - W/"11b6d1d9eb9720313d1fd72196df9595" | ||
| Referrer-Policy: | ||
| - strict-origin-when-cross-origin | ||
| Server: | ||
| - nginx/1.18.0 | ||
| Transfer-Encoding: | ||
| - chunked | ||
| Vary: | ||
| - Origin | ||
| X-Content-Type-Options: | ||
| - nosniff | ||
| X-Download-Options: | ||
| - noopen | ||
| X-Frame-Options: | ||
| - SAMEORIGIN | ||
| X-Permitted-Cross-Domain-Policies: | ||
| - none | ||
| X-Rack-CORS: | ||
| - miss; no-origin | ||
| X-Request-Id: | ||
| - ce585d4e-d4dc-47bb-9f2a-f109e6a3a59b | ||
| X-Runtime: | ||
| - '0.101889' | ||
| X-XSS-Protection: | ||
| - 1; mode=block | ||
| http_version: HTTP/1.1 | ||
| status_code: 200 | ||
| - request: | ||
| body: '' | ||
| headers: | ||
| accept: | ||
| - '*/*' | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| connection: | ||
| - keep-alive | ||
| user-agent: | ||
| - python-httpx/0.22.0 | ||
| method: GET | ||
| uri: null | ||
| response: | ||
| content: '{"data":{"id":"328568","type":"well","attributes":{"asset_id":30719716},"relationships":{}}}' | ||
| headers: | ||
| Cache-Control: | ||
| - max-age=0, private, must-revalidate | ||
| Connection: | ||
| - keep-alive | ||
| Content-Encoding: | ||
| - gzip | ||
| Content-Type: | ||
| - application/json; charset=utf-8 | ||
| Date: | ||
| - Mon, 23 May 2022 11:41:15 GMT | ||
| ETag: | ||
| - W/"b161ea51687ef8fd4b47fd4dc1ca754d" | ||
| Referrer-Policy: | ||
| - strict-origin-when-cross-origin | ||
| Server: | ||
| - nginx/1.18.0 | ||
| Transfer-Encoding: | ||
| - chunked | ||
| Vary: | ||
| - Origin | ||
| X-Content-Type-Options: | ||
| - nosniff | ||
| X-Download-Options: | ||
| - noopen | ||
| X-Frame-Options: | ||
| - SAMEORIGIN | ||
| X-Permitted-Cross-Domain-Policies: | ||
| - none | ||
| X-Rack-CORS: | ||
| - miss; no-origin | ||
| X-Request-Id: | ||
| - 05e9b6f6-ab30-4478-8f0d-dfe7e7679ac7 | ||
| X-Runtime: | ||
| - '0.044065' | ||
| X-XSS-Protection: | ||
| - 1; mode=block | ||
| http_version: HTTP/1.1 | ||
| status_code: 200 | ||
| - request: | ||
| body: '' | ||
| headers: | ||
| accept: | ||
| - '*/*' | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| connection: | ||
| - keep-alive | ||
| user-agent: | ||
| - python-httpx/0.22.0 | ||
| method: DELETE | ||
| uri: null | ||
| response: | ||
| content: '{"deleted_count":0}' | ||
| headers: | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '19' | ||
| Content-Type: | ||
| - application/json | ||
| Date: | ||
| - Mon, 23 May 2022 11:41:16 GMT | ||
| server: | ||
| - uvicorn | ||
| http_version: HTTP/1.1 | ||
| status_code: 200 | ||
| - request: | ||
| body: '[{"asset_id": 30719716, "version": 1, "data": {"k1": "v1"}, "timestamp": | ||
| 10}]' | ||
| headers: | ||
| accept: | ||
| - '*/*' | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| connection: | ||
| - keep-alive | ||
| content-length: | ||
| - '77' | ||
| content-type: | ||
| - application/json | ||
| user-agent: | ||
| - python-httpx/0.22.0 | ||
| method: POST | ||
| uri: null | ||
| response: | ||
| content: '{"inserted_ids":["628b72dcd6aff355ccea8b78"],"failed_count":0,"messages":[]}' | ||
| headers: | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '76' | ||
| Content-Type: | ||
| - application/json | ||
| Date: | ||
| - Mon, 23 May 2022 11:41:16 GMT | ||
| server: | ||
| - uvicorn | ||
| http_version: HTTP/1.1 | ||
| status_code: 200 | ||
| - request: | ||
| body: '{"data": {"k2": "v2"}, "version": 2, "company_id": 80, "timestamp": 11, | ||
| "asset_id": 30719716}' | ||
| headers: | ||
| accept: | ||
| - '*/*' | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| connection: | ||
| - keep-alive | ||
| content-length: | ||
| - '93' | ||
| content-type: | ||
| - application/json | ||
| user-agent: | ||
| - python-httpx/0.22.0 | ||
| x-corva-app: | ||
| - python-sdk-autotest-2022-05-23 11:41:14+00:00 | ||
| method: PUT | ||
| uri: null | ||
| response: | ||
| content: '{"_id":"628b72dcd6aff355ccea8b78","company_id":80,"asset_id":30719716,"version":2,"provider":"big-data-energy","collection":"python-sdk-autotests","data":{"k2":"v2"},"timestamp":11,"app_key":"big-data-energy.python_sdk_app_for_autotests"}' | ||
| headers: | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '238' | ||
| Content-Type: | ||
| - application/json | ||
| Date: | ||
| - Mon, 23 May 2022 11:41:17 GMT | ||
| server: | ||
| - uvicorn | ||
| http_version: HTTP/1.1 | ||
| status_code: 200 | ||
| - request: | ||
| body: '' | ||
| headers: | ||
| accept: | ||
| - '*/*' | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| connection: | ||
| - keep-alive | ||
| user-agent: | ||
| - python-httpx/0.22.0 | ||
| method: GET | ||
| uri: null | ||
| response: | ||
| content: '{"_id":"628b72dcd6aff355ccea8b78","company_id":80,"asset_id":30719716,"version":2,"provider":"big-data-energy","collection":"python-sdk-autotests","data":{"k2":"v2"},"timestamp":11,"app_key":"big-data-energy.python_sdk_app_for_autotests"}' | ||
| headers: | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '238' | ||
| Content-Type: | ||
| - application/json | ||
| Date: | ||
| - Mon, 23 May 2022 11:41:17 GMT | ||
| server: | ||
| - uvicorn | ||
| http_version: HTTP/1.1 | ||
| status_code: 200 | ||
| - request: | ||
| body: '' | ||
| headers: | ||
| accept: | ||
| - '*/*' | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| connection: | ||
| - keep-alive | ||
| user-agent: | ||
| - python-httpx/0.22.0 | ||
| method: DELETE | ||
| uri: null | ||
| response: | ||
| content: '{"status":"deleted"}' | ||
| headers: | ||
| Cache-Control: | ||
| - max-age=0, private, must-revalidate | ||
| Connection: | ||
| - keep-alive | ||
| Content-Encoding: | ||
| - gzip | ||
| Content-Type: | ||
| - application/json; charset=utf-8 | ||
| Date: | ||
| - Mon, 23 May 2022 11:41:18 GMT | ||
| ETag: | ||
| - W/"4df20f95e824b2af44a61642d88daaf0" | ||
| Referrer-Policy: | ||
| - strict-origin-when-cross-origin | ||
| Server: | ||
| - nginx/1.18.0 | ||
| Transfer-Encoding: | ||
| - chunked | ||
| Vary: | ||
| - Origin | ||
| X-Content-Type-Options: | ||
| - nosniff | ||
| X-Download-Options: | ||
| - noopen | ||
| X-Frame-Options: | ||
| - SAMEORIGIN | ||
| X-Permitted-Cross-Domain-Policies: | ||
| - none | ||
| X-Rack-CORS: | ||
| - miss; no-origin | ||
| X-Request-Id: | ||
| - db6d7a71-cce6-4279-8050-eb7c52cecd26 | ||
| X-Runtime: | ||
| - '0.073215' | ||
| X-XSS-Protection: | ||
| - 1; mode=block | ||
| http_version: HTTP/1.1 | ||
| status_code: 200 | ||
| - request: | ||
| body: '' | ||
| headers: | ||
| accept: | ||
| - '*/*' | ||
| accept-encoding: | ||
| - gzip, deflate | ||
| connection: | ||
| - keep-alive | ||
| user-agent: | ||
| - python-httpx/0.22.0 | ||
| method: DELETE | ||
| uri: null | ||
| response: | ||
| content: '{"deleted_count":1}' | ||
| headers: | ||
| Connection: | ||
| - keep-alive | ||
| Content-Length: | ||
| - '19' | ||
| Content-Type: | ||
| - application/json | ||
| Date: | ||
| - Mon, 23 May 2022 11:41:18 GMT | ||
| server: | ||
| - uvicorn | ||
| http_version: HTTP/1.1 | ||
| status_code: 200 | ||
| version: 1 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it technically possible for one company provide company name of another company and replace their document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is regulated by permissions of the company making the request. As far as I know company A can request access to
readsome dataset of company B.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, it should be technically possible within the sdk and "permission regulating" part is in place in data-api. Correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct