Skip to content

Commit

Permalink
generic: bump inspire-schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
DonHaul committed Jan 10, 2025
1 parent 6dcf330 commit df53be2
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 43 deletions.
8 changes: 4 additions & 4 deletions backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Flask = ">=1.0.2"
msgpack = "==0.6.2"

python = ">=3.11,<3.12"
inspire-schemas = ">=61.6.4"
inspire-schemas = ">=61.6.8"
inspire-utils = ">=3.0.63"
inspire-service-orcid = {git = "https://github.com/inspirehep/inspire-service-orcid.git", rev = "1a0e762e58bc9cac65f7665b9831993c017fd8bb"}
inspire-json-merger = "^11.0.37"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interactions:
Connection:
- keep-alive
method: GET
uri: http://host.docker.internal:8080/api/doi/10.1234567/test
uri: http://host.docker.internal:8080/api/doi/10.1234568/test
response:
body:
string: '{"status": 404, "message": "PID does not exist."}'
Expand All @@ -21,7 +21,7 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 11 Dec 2024 16:16:05 GMT
- Fri, 10 Jan 2025 10:28:29 GMT
Server:
- nginx/1.19.1
status:
Expand All @@ -37,7 +37,7 @@ interactions:
Connection:
- keep-alive
method: GET
uri: http://host.docker.internal:8080/api/doi/10.1234567/test
uri: http://host.docker.internal:8080/api/doi/10.1234568/test
response:
body:
string: '{"status": 404, "message": "PID does not exist."}'
Expand All @@ -49,7 +49,7 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 11 Dec 2024 16:16:06 GMT
- Fri, 10 Jan 2025 10:28:30 GMT
Server:
- nginx/1.19.1
status:
Expand All @@ -65,7 +65,7 @@ interactions:
Connection:
- keep-alive
method: GET
uri: http://host.docker.internal:8080/api/doi/10.1234567/test
uri: http://host.docker.internal:8080/api/doi/10.1234568/test
response:
body:
string: '{"status": 404, "message": "PID does not exist."}'
Expand All @@ -77,7 +77,7 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 11 Dec 2024 16:16:08 GMT
- Fri, 10 Jan 2025 10:28:32 GMT
Server:
- nginx/1.19.1
status:
Expand All @@ -93,7 +93,7 @@ interactions:
Connection:
- keep-alive
method: GET
uri: http://host.docker.internal:8080/api/doi/10.1234567/test
uri: http://host.docker.internal:8080/api/doi/10.1234568/test
response:
body:
string: '{"status": 404, "message": "PID does not exist."}'
Expand All @@ -105,7 +105,7 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 11 Dec 2024 16:16:12 GMT
- Fri, 10 Jan 2025 10:28:36 GMT
Server:
- nginx/1.19.1
status:
Expand All @@ -121,7 +121,7 @@ interactions:
Connection:
- keep-alive
method: GET
uri: http://host.docker.internal:8080/api/doi/10.1234567/test
uri: http://host.docker.internal:8080/api/doi/10.1234568/test
response:
body:
string: '{"status": 404, "message": "PID does not exist."}'
Expand All @@ -133,15 +133,17 @@ interactions:
Content-Type:
- application/json
Date:
- Wed, 11 Dec 2024 16:16:20 GMT
- Fri, 10 Jan 2025 10:28:44 GMT
Server:
- nginx/1.19.1
status:
code: 404
message: NOT FOUND
- request:
body: '{"_collections": ["Data"], "$schema": "https://inspirehep.net/schemas/records/data.json",
"dois": [{"value": "10.1234567/test", "material": "data"}]}'
"dois": [{"value": "10.1234568/test", "material": "data"}], "acquisition_source":
{"source": "inspirehep", "submission_number": "2829504", "datetime": "2025-01-09T16:14:51.647320+00:00",
"method": "inspirehep"}}'
headers:
Accept:
- application/vnd+inspire.record.raw+json
Expand All @@ -150,37 +152,37 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '149'
- '301'
Content-Type:
- application/json
method: POST
uri: http://host.docker.internal:8080/api/data
response:
body:
string: '{"metadata":{"_collections":["Data"],"$schema":"https://inspirehep.net/schemas/records/data.json","dois":[{"value":"10.1234567/test","material":"data"}],"control_number":2610637,"self":{"$ref":"http://localhost:8000/api/data/2610637"}},"revision_id":0,"updated":"2024-12-11T16:16:20.351311+00:00","uuid":"b765f128-72f8-4120-ac43-9242ad2c40a6","created":"2024-12-11T16:16:20.351308+00:00","id":"{2610637}","links":{"json":"http://localhost:8000/api/data/%7B2610637%7D?format=json"}}'
string: '{"links":{"json":"http://localhost:8000/api/data/%7B2727285%7D?format=json"},"revision_id":0,"uuid":"d0e25a25-c167-43c4-a5ed-0746758572df","created":"2025-01-10T10:28:44.881337+00:00","updated":"2025-01-10T10:28:44.881390+00:00","metadata":{"_collections":["Data"],"$schema":"https://inspirehep.net/schemas/records/data.json","dois":[{"value":"10.1234568/test","material":"data"}],"acquisition_source":{"source":"inspirehep","submission_number":"2829504","datetime":"2025-01-09T16:14:51.647320+00:00","method":"inspirehep"},"control_number":2727285,"self":{"$ref":"http://localhost:8000/api/data/2727285"}},"id":"{2727285}"}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Length:
- '481'
- '624'
Content-Type:
- application/vnd+inspire.record.raw+json
Date:
- Wed, 11 Dec 2024 16:16:20 GMT
- Fri, 10 Jan 2025 10:28:44 GMT
ETag:
- W/"0"
Last-Modified:
- Wed, 11 Dec 2024 16:16:20 GMT
- Fri, 10 Jan 2025 10:28:44 GMT
Link:
- <json>; rel="http://localhost:8000/api/data/%7B2610637%7D?format=json"
- <json>; rel="http://localhost:8000/api/data/%7B2727285%7D?format=json"
Server:
- nginx/1.19.1
Vary:
- Accept,Accept-Encoding,Accept-Language
location:
- http://localhost:8000/api/data/%7B2610637%7D
- http://localhost:8000/api/data/%7B2727285%7D
status:
code: 201
message: CREATED
Expand Down
39 changes: 20 additions & 19 deletions workflows/tests/cassettes/TestDataHarvest.test_load_record_put.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ interactions:
uri: http://host.docker.internal:8080/api/doi/10.8756/tTM
response:
body:
string: '{"metadata":{"dois":[{"value":"10.8756/tTM","material":"data"}],"self":{"$ref":"http://localhost:8000/api/data/777"},"urls":[{"value":"http://HoXZ","description":"tempor
string: '{"links":{"bibtex":"http://localhost:8000/api/doi/10.8756/ttm?format=bibtex","latex-eu":"http://localhost:8000/api/doi/10.8756/ttm?format=latex-eu","latex-us":"http://localhost:8000/api/doi/10.8756/ttm?format=latex-us","json":"http://localhost:8000/api/doi/10.8756/ttm?format=json","cv":"http://localhost:8000/api/doi/10.8756/ttm?format=cv"},"revision_id":0,"uuid":"639d8a22-e982-4fdb-b60d-8fce2e78fd34","created":"2025-01-10T08:59:12.166145+00:00","updated":"2025-01-10T08:59:12.166147+00:00","metadata":{"dois":[{"value":"10.8756/tTM","source":"in
ad et","material":"data"},{"value":"10.5/.Aww=bT@","source":"mollit deserunt
eu","material":"version"},{"value":"10.0.9747720/#}O=W:$","source":"adipisicing
et","material":"part"}],"self":{"$ref":"http://localhost:8000/api/data/777"},"urls":[{"value":"http://HoXZ","description":"tempor
laboris nostrud amet dolor"},{"value":"http://CBBgCi","description":"irure"},{"value":"https://aE,","description":"reprehenderit
lab"},{"value":"http://Erus/87","description":"magna"},{"value":"https://lHCOlUYMP","description":"laborum
eiusmod nulla ad ea"}],"titles":[{"title":"Test title","source":"pariatur
Expand Down Expand Up @@ -40,22 +43,22 @@ interactions:
eiusmod anim aute in","record":{"$ref":"http://lWwb6D/api/experiments/547678"}}],"control_number":777,"legacy_version":"ea","deleted_records":[{"$ref":"http://J3vLBvgzhC/api/data/546456"},{"$ref":"http://txGvpx7fpfb/api/data/34534567"}],"acquisition_source":{"email":"[email protected]","orcid":"7331-1113-6863-4887","method":"oai","source":"dolore
mollit","datetime":"5096-09-22T20:00:59.888Z","internal_uid":-19966101,"submission_number":"n"},"accelerator_experiments":[{"record":{"$ref":"http://Wba/api/experiments/12234"},"experiment":"exercitation
officia sint","accelerator":"ipsum ess","institution":"veniam","legacy_name":"reprehenderit
incididunt eiusmod exercitation","curated_relation":true}]},"revision_id":7,"updated":"2024-12-11T14:56:27.449027+00:00","uuid":"e5430afb-8761-4eaf-9188-e9d3a7bd4207","created":"2024-12-11T14:02:11.066149+00:00","id":"10.8756/ttm","links":{"bibtex":"http://localhost:8000/api/doi/10.8756/ttm?format=bibtex","latex-eu":"http://localhost:8000/api/doi/10.8756/ttm?format=latex-eu","latex-us":"http://localhost:8000/api/doi/10.8756/ttm?format=latex-us","json":"http://localhost:8000/api/doi/10.8756/ttm?format=json","cv":"http://localhost:8000/api/doi/10.8756/ttm?format=cv"}}'
incididunt eiusmod exercitation","curated_relation":true}]},"id":"10.8756/ttm"}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Length:
- '5272'
- '5446'
Content-Type:
- application/vnd+inspire.record.raw+json
Date:
- Wed, 11 Dec 2024 16:15:43 GMT
- Fri, 10 Jan 2025 10:29:41 GMT
ETag:
- W/"7"
- W/"0"
Last-Modified:
- Wed, 11 Dec 2024 14:56:27 GMT
- Fri, 10 Jan 2025 08:59:12 GMT
Link:
- <bibtex>; rel="http://localhost:8000/api/doi/10.8756/ttm?format=bibtex", <latex-eu>;
rel="http://localhost:8000/api/doi/10.8756/ttm?format=latex-eu", <latex-us>;
Expand Down Expand Up @@ -123,9 +126,8 @@ interactions:
"ut eiusmod anim aute in", "record": {"$ref": "http://lWwb6D/api/experiments/547678"}}],
"control_number": 777, "legacy_version": "ea", "deleted_records": [{"$ref":
"http://J3vLBvgzhC/api/data/546456"}, {"$ref": "http://txGvpx7fpfb/api/data/34534567"}],
"acquisition_source": {"email": "[email protected]", "orcid": "7331-1113-6863-4887",
"method": "oai", "source": "dolore mollit", "datetime": "5096-09-22T20:00:59.888Z",
"internal_uid": -19966101, "submission_number": "n"}, "accelerator_experiments":
"acquisition_source": {"source": "inspirehep", "submission_number": "2829504",
"datetime": "2025-01-09T16:14:51.647320+00:00", "method": "inspirehep"}, "accelerator_experiments":
[{"record": {"$ref": "http://Wba/api/experiments/12234"}, "experiment": "exercitation
officia sint", "accelerator": "ipsum ess", "institution": "veniam", "legacy_name":
"reprehenderit incididunt eiusmod exercitation", "curated_relation": true}]}'
Expand All @@ -137,16 +139,16 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '5059'
- '4979'
Content-Type:
- application/json
If-Match:
- '"7"'
- '"0"'
method: PUT
uri: http://host.docker.internal:8080/api/data/777
response:
body:
string: '{"metadata":{"dois":[{"value":"10.8756/tTM","material":"data"}],"self":{"$ref":"http://localhost:8000/api/data/777"},"urls":[{"value":"http://HoXZ","description":"tempor
string: '{"links":{"json":"http://localhost:8000/api/data/777?format=json"},"revision_id":1,"uuid":"639d8a22-e982-4fdb-b60d-8fce2e78fd34","created":"2025-01-10T08:59:12.166145+00:00","updated":"2025-01-10T10:29:41.568306+00:00","metadata":{"dois":[{"value":"10.8756/tTM","material":"data"}],"self":{"$ref":"http://localhost:8000/api/data/777"},"urls":[{"value":"http://HoXZ","description":"tempor
laboris nostrud amet dolor"},{"value":"http://CBBgCi","description":"irure"},{"value":"https://aE,","description":"reprehenderit
lab"},{"value":"http://Erus/87","description":"magna"},{"value":"https://lHCOlUYMP","description":"laborum
eiusmod nulla ad ea"}],"titles":[{"title":"Test title","source":"pariatur
Expand All @@ -171,25 +173,24 @@ interactions:
id sunt","source":"ut"},{"value":"mollit","source":"dolor eu et pariatur"}],"literature":[{"doi":{"value":"10.912/W/K[Bz","source":"amet
Ut"},"record":{"$ref":"http://XVxZ15mkm/api/literature/44707"}},{"record":{"$ref":"http://l/api/literature/873915"}}],"_collections":["Data"],"creation_date":"2005-05-03","collaborations":[{"value":"ex
occaecat sunt eu","record":{"$ref":"http://XcyD6G/api/experiments/1234456"}},{"value":"ut
eiusmod anim aute in","record":{"$ref":"http://lWwb6D/api/experiments/547678"}}],"control_number":777,"legacy_version":"ea","deleted_records":[{"$ref":"http://J3vLBvgzhC/api/data/546456"},{"$ref":"http://txGvpx7fpfb/api/data/34534567"}],"acquisition_source":{"email":"[email protected]","orcid":"7331-1113-6863-4887","method":"oai","source":"dolore
mollit","datetime":"5096-09-22T20:00:59.888Z","internal_uid":-19966101,"submission_number":"n"},"accelerator_experiments":[{"record":{"$ref":"http://Wba/api/experiments/12234"},"experiment":"exercitation
eiusmod anim aute in","record":{"$ref":"http://lWwb6D/api/experiments/547678"}}],"control_number":777,"legacy_version":"ea","deleted_records":[{"$ref":"http://J3vLBvgzhC/api/data/546456"},{"$ref":"http://txGvpx7fpfb/api/data/34534567"}],"acquisition_source":{"source":"inspirehep","submission_number":"2829504","datetime":"2025-01-09T16:14:51.647320+00:00","method":"inspirehep"},"accelerator_experiments":[{"record":{"$ref":"http://Wba/api/experiments/12234"},"experiment":"exercitation
officia sint","accelerator":"ipsum ess","institution":"veniam","legacy_name":"reprehenderit
incididunt eiusmod exercitation","curated_relation":true}]},"revision_id":8,"updated":"2024-12-11T16:15:43.855471+00:00","uuid":"e5430afb-8761-4eaf-9188-e9d3a7bd4207","created":"2024-12-11T14:02:11.066149+00:00","id":"777","links":{"json":"http://localhost:8000/api/data/777?format=json"}}'
incididunt eiusmod exercitation","curated_relation":true}]},"id":"777"}'
headers:
Cache-Control:
- no-cache
Connection:
- keep-alive
Content-Length:
- '4989'
- '4915'
Content-Type:
- application/vnd+inspire.record.raw+json
Date:
- Wed, 11 Dec 2024 16:15:43 GMT
- Fri, 10 Jan 2025 10:29:41 GMT
ETag:
- W/"8"
- W/"1"
Last-Modified:
- Wed, 11 Dec 2024 16:15:43 GMT
- Fri, 10 Jan 2025 10:29:41 GMT
Link:
- <json>; rel="http://localhost:8000/api/data/777?format=json"
Server:
Expand Down
1 change: 1 addition & 0 deletions workflows/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ def vcr_config():
"decode_compressed_response": True,
"filter_headers": ("Authorization", "User-Agent"),
"record_mode": "once",
"match_on": ["method", "scheme", "host", "port", "path", "query", "body"],
}
15 changes: 14 additions & 1 deletion workflows/tests/test_data_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ def test_load_record_put(self):
"_collections": ["Data"],
"$schema": "https://inspirehep.net/schemas/records/data.json",
"dois": [{"value": "10.8756/tTM", "material": "data"}],
"acquisition_source": {
"source": "inspirehep",
"submission_number": "2829504",
"datetime": "2025-01-09T16:14:51.647320+00:00",
"method": "inspirehep",
},
}
task = self.dag.get_task("process_record.load_record")
task.op_args = (record,)
Expand Down Expand Up @@ -126,9 +132,16 @@ def test_load_record_post(self):
record = {
"_collections": ["Data"],
"$schema": "https://inspirehep.net/schemas/records/data.json",
"dois": [{"value": "10.1234567/test", "material": "data"}],
"dois": [{"value": "10.1234568/test", "material": "data"}],
"acquisition_source": {
"source": "inspirehep",
"submission_number": "2829504",
"datetime": "2025-01-09T16:14:51.647320+00:00",
"method": "inspirehep",
},
}
task = self.dag.get_task("process_record.load_record")
task.op_args = (record,)
json_response = task.execute(context=self.context)
# import pdb; pdb.set_trace()
assert json_response

0 comments on commit df53be2

Please sign in to comment.