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

Fix avro names #408

Merged
merged 9 commits into from
Jun 24, 2021
Merged

Fix avro names #408

merged 9 commits into from
Jun 24, 2021

Conversation

tetron
Copy link
Member

@tetron tetron commented Jun 23, 2021

For the part that still goes to avro for validation, converts to avro-compatible names with a dotted namespace instead of half standalone symbols and half URIs.

Fixes #326

tetron added 2 commits June 23, 2021 16:58
The key difference is that field names, symbols and type names are
unified in the Salad/RDF data model, but are separate in the Avro data
model.  Types and fields names and enum symbols need to have their
names mapped differently.  This is now handled.

The practical effect is that this fixes a longstanding issue in
referencing types from imported schemas, as is done in cwltool
extension schema to reference cwl:Expression.

refs #326
@tetron
Copy link
Member Author

tetron commented Jun 23, 2021

refs #326

@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #408 (c1d0e20) into main (ab933f0) will decrease coverage by 0.52%.
The diff coverage is 92.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #408      +/-   ##
==========================================
- Coverage   78.98%   78.45%   -0.53%     
==========================================
  Files          18       18              
  Lines        3231     3245      +14     
  Branches      872      876       +4     
==========================================
- Hits         2552     2546       -6     
- Misses        441      460      +19     
- Partials      238      239       +1     
Impacted Files Coverage Δ
schema_salad/codegen_base.py 94.59% <0.00%> (ø)
schema_salad/schema.py 76.57% <92.00%> (+0.10%) ⬆️
schema_salad/java_codegen.py 90.56% <100.00%> (ø)
schema_salad/makedoc.py 82.95% <100.00%> (ø)
schema_salad/python_codegen.py 95.27% <100.00%> (+0.06%) ⬆️
schema_salad/validate.py 70.77% <100.00%> (+1.19%) ⬆️
schema_salad/fetcher.py 62.00% <0.00%> (-19.00%) ⬇️
schema_salad/ref_resolver.py 84.42% <0.00%> (-0.59%) ⬇️
schema_salad/sourceline.py 66.66% <0.00%> (-0.47%) ⬇️
schema_salad/jsonld_context.py 74.69% <0.00%> (+0.60%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab933f0...c1d0e20. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Jun 23, 2021

This pull request introduces 2 alerts when merging 353b8b1 into ab933f0 - view on LGTM.com

new alerts:

  • 2 for Unused import

@mr-c
Copy link
Member

mr-c commented Jun 24, 2021

@rupertnash can you confirm, and maybe contribute your use case as a pytest?

@rupertnash
Copy link
Contributor

Aye, I'll take a peek

@rupertnash
Copy link
Contributor

I had a recollection that I'd done this https://github.com/rupertnash/schema_salad/tree/avro-name-conversion.

I'll rebase it onto this branch

@mr-c
Copy link
Member

mr-c commented Jun 24, 2021

I confirm that @rupertnash 's test fails without the changes in this PR; thanks @tetron and @rupertnash !

@mr-c mr-c enabled auto-merge (rebase) June 24, 2021 09:34
@mr-c mr-c force-pushed the fix-avro-names branch from b5c02b5 to c1d0e20 Compare June 24, 2021 09:35
@mr-c mr-c merged commit 2f03f6d into main Jun 24, 2021
@mr-c mr-c deleted the fix-avro-names branch June 24, 2021 09:39
tetron added a commit to common-workflow-language/cwltool that referenced this pull request Jun 24, 2021
Specifically common-workflow-language/schema_salad#408

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
tetron added a commit to common-workflow-language/cwltool that referenced this pull request Jun 28, 2021
* Update schema-salad dependency for bug fix

Specifically common-workflow-language/schema_salad#408

* Use vocabulary in schema salad validation
* Fixes internal Avro type change from File to org.w3id.cwl.cwl.File

Co-authored-by: Michael R. Crusoe <1330696+mr-c@users.noreply.github.com>
Co-authored-by: Michael R. Crusoe <michael.crusoe@gmail.com>
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.

Schema names not being converted to Avro-style names correctly
3 participants