Skip to content
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

refactor: replace resource instance factory (DEV-2876) #594

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e592ade
start
BalduinLandolt Oct 25, 2023
8faf15e
introduce BitstreamInfo object
BalduinLandolt Oct 25, 2023
2e03d79
Update create_resource.py
BalduinLandolt Oct 25, 2023
37a613c
Update create_resource.py
BalduinLandolt Oct 25, 2023
2d6d8f1
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Oct 25, 2023
3784754
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Oct 27, 2023
bb38dc6
add more file types
BalduinLandolt Oct 27, 2023
281ff5a
handle more value types
BalduinLandolt Oct 27, 2023
7970c34
Update create_resource.py
BalduinLandolt Oct 28, 2023
bc53000
fix stash to json serialization
BalduinLandolt Oct 28, 2023
48e4600
Update create_resource.py
BalduinLandolt Oct 28, 2023
1067922
use class for creating resource
BalduinLandolt Oct 28, 2023
d22169d
apply changes on caller side
BalduinLandolt Oct 28, 2023
fcee1da
wire up getting project IRI
BalduinLandolt Oct 28, 2023
97f9e23
various improvements
BalduinLandolt Oct 28, 2023
6319dce
tidy up
BalduinLandolt Oct 28, 2023
49f4b8d
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Oct 28, 2023
d8eba82
Fix time value
BalduinLandolt Oct 30, 2023
2e84a70
fix
BalduinLandolt Oct 30, 2023
d973ffc
rename
BalduinLandolt Oct 30, 2023
624fa35
add project client
BalduinLandolt Oct 30, 2023
1fa070e
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Oct 30, 2023
3dc91b4
fix merge issues
BalduinLandolt Oct 30, 2023
6099935
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Oct 31, 2023
eee8310
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Oct 31, 2023
4357c08
extract json-ld context handling and use multiple iris if needed
BalduinLandolt Oct 31, 2023
355c851
fix encoding
BalduinLandolt Nov 1, 2023
f5ca298
use project client for contex
BalduinLandolt Nov 1, 2023
cf7f3db
Update resource_create_client.py
BalduinLandolt Nov 1, 2023
1833b26
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Nov 1, 2023
925da20
fix and cleanup
BalduinLandolt Nov 1, 2023
954621a
cleanup
BalduinLandolt Nov 1, 2023
c6f4c1a
add list client
BalduinLandolt Nov 1, 2023
216eac9
fix list id resolving
BalduinLandolt Nov 1, 2023
ef70979
fix unit test
BalduinLandolt Nov 1, 2023
cba6e13
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Nov 1, 2023
874a240
fix case where API returns no graph
BalduinLandolt Nov 1, 2023
ea9a496
make linters happier
BalduinLandolt Nov 1, 2023
6f6605e
fix CLI
BalduinLandolt Nov 1, 2023
044475a
fix test
BalduinLandolt Nov 1, 2023
47184b3
get rid of custom json encoder
BalduinLandolt Nov 1, 2023
655b9fb
Delete resource.py
BalduinLandolt Nov 1, 2023
8ddd234
Delete test_resource.py
BalduinLandolt Nov 1, 2023
b045a8d
silence pylint
BalduinLandolt Nov 1, 2023
e06a6ad
docstrings
BalduinLandolt Nov 1, 2023
6d0a447
split test
BalduinLandolt Nov 1, 2023
559067f
fail if a non-existent ontology is specified in the XML
BalduinLandolt Nov 1, 2023
701bf21
Update xmlupload.py
BalduinLandolt Nov 1, 2023
9052790
Update xmlupload.py
BalduinLandolt Nov 2, 2023
5db4743
fix fully qualified IRI for link value
BalduinLandolt Nov 2, 2023
bac7463
fix
BalduinLandolt Nov 2, 2023
638851e
cleanup
BalduinLandolt Nov 2, 2023
8c69a1d
cleanup
BalduinLandolt Nov 2, 2023
5643f79
apply review - part I
BalduinLandolt Nov 2, 2023
f77b038
fix unit tests
BalduinLandolt Nov 3, 2023
73240af
refactor: apply feedback and improve error handling (#620)
BalduinLandolt Nov 7, 2023
89a0dd3
Merge branch 'main' into feature/dev-2876-remove-use-of-resource-inst…
BalduinLandolt Nov 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/file-formats/xml-data-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Attributes:

#### `<boolean>`

The `<boolean>` element must contain the string "true" or "false", or the numeral 1 (true) or 0 (false).
The `<boolean>` element must contain the string "true"/"True" or "false"/"False", or the numeral 1 (true) or 0 (false).

Attributes:

Expand Down
4 changes: 2 additions & 2 deletions src/dsp_tools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from dsp_tools.utils.rosetta import upload_rosetta
from dsp_tools.utils.shared import validate_xml_against_schema
from dsp_tools.utils.stack_handling import StackConfiguration, StackHandler
from dsp_tools.utils.xmlupload.upload_config import UploadConfig
from dsp_tools.utils.xmlupload.upload_config import DiagnosticsConfig, UploadConfig
from dsp_tools.utils.xmlupload.xmlupload import xmlupload

logger = get_logger(__name__)
Expand Down Expand Up @@ -485,7 +485,7 @@ def _call_requested_action(args: argparse.Namespace) -> bool:
password=args.password,
imgdir=args.imgdir,
sipi=args.sipi_url,
config=UploadConfig(verbose=args.verbose, dump=args.dump),
config=UploadConfig(diagnostics=DiagnosticsConfig(verbose=args.verbose, dump=args.dump)),
)
elif args.action == "process-files":
success = process_files(
Expand Down
8 changes: 6 additions & 2 deletions src/dsp_tools/connection/connection_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ def post(
response = requests.post(
url=url,
headers=headers,
data=jsondata,
# if data is not encoded as bytes, issues can occur with non-ASCII characters,
# where the content-length of the request will turn out to be different from the actual length
data=jsondata.encode("utf-8") if jsondata else None,
BalduinLandolt marked this conversation as resolved.
Show resolved Hide resolved
timeout=timeout,
)
if self.dump:
Expand Down Expand Up @@ -265,7 +267,9 @@ def put(
response = requests.put(
url=url,
headers=headers,
data=jsondata,
# if data is not encoded as bytes, issues can occur with non-ASCII characters,
# where the content-length of the request will turn out to be different from the actual length
data=jsondata.encode("utf-8") if jsondata else None,
timeout=timeout,
)
if self.dump:
Expand Down