Skip to content

Commit

Permalink
fix record type version integer parsing (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels authored Nov 10, 2022
1 parent 02cfd2b commit 68ffeb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Legolas"
uuid = "741b9549-f6ed-4911-9fbf-4a1c0c97f0cd"
authors = ["Beacon Biosignals, Inc."]
version = "0.5.3"
version = "0.5.4"

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
Expand Down
2 changes: 1 addition & 1 deletion src/schemas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ function _generate_record_type_definitions(schema_version::SchemaVersion, record
end

function _parse_record_type_symbol(t::Symbol)
pv = split(string(t), 'V')
pv = rsplit(string(t), 'V'; limit=2)
if length(pv) == 2
p, v = pv
p = Symbol(p)
Expand Down
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ end

@schema "test.new" New

@schema "test.has-a-v1-in-the-middle" HasAV1InTheMiddle
@version HasAV1InTheMiddleV1 begin
id::UUID
end
@version HasAV1InTheMiddleV2 begin
id::UUID
x::Int
end

@testset "`Legolas.@version` and associated utilities for declared `Legolas.SchemaVersion`s" begin
@testset "Legolas.SchemaVersionDeclarationError" begin
@test_throws SchemaVersionDeclarationError("malformed or missing declaration of required fields") eval(:(@version(NewV1, $(Expr(:block, LineNumberNode(1, :test))))))
Expand Down

2 comments on commit 68ffeb3

@jrevels
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/72006

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.4 -m "<description of version>" 68ffeb3f17585ff2d20ef7a201cd206b48f9a010
git push origin v0.5.4

Please sign in to comment.