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

Standard library function write_json does prohibited serialization of integer keys #702

Open
stxue1 opened this issue Jul 3, 2024 · 0 comments
Labels
interop Bears on spec compatibility

Comments

@stxue1
Copy link

stxue1 commented Jul 3, 2024

The WDL spec states that write_json cannot serialize a map with integer keys.

  Pair[Int, Map[Int, String]] x = (1, {2: "hello"})
  # this fails with an error - Map with Int keys is not serializable
  File f = write_json(x)

MiniWDL will coerce Int to String, meaning the map above is serializable from MiniWDL's perspective:

version 1.1

workflow write_json_fail {
  Pair[Int, Map[Int, String]] x = (1, {2: "hello"})
  # this fails with an error - Map with Int keys is not serializable
  File f = write_json(x)
  output {
    File out = f
  }
}
2024-07-02 18:25:13.770 wdl.w:write_json_fail workflow start :: name: "write_json_fail", source: "/home/heaucques/Documents/wdl-conformance-tests/unit_tests/write_json_fail.wdl", line: 3, column: 1, dir: "/home/heaucques/Documents/wdl-conformance-tests/20240702_182513_write_json_fail"
2024-07-02 18:25:13.772 wdl.w:write_json_fail miniwdl :: version: "v1.12.0", uname: "Linux pop-os 6.9.3-76060903-generic #202405300957~1718348209~22.04~7817b67 SMP PREEMPT_DYNAMIC Mon J x86_64"
2024-07-02 18:25:13.786 wdl.w:write_json_fail done
{
  "dir": "/home/heaucques/Documents/wdl-conformance-tests/20240702_182513_write_json_fail",
  "outputs": {
    "write_json_fail.out": "/home/heaucques/Documents/wdl-conformance-tests/20240702_182513_write_json_fail/out/out/tmpctwkrlfx"
  }
}
$ cat /home/heaucques/Documents/wdl-conformance-tests/20240702_182513_write_json_fail/out/out/tmpctwkrlfx
{"left": 1, "right": {"2": "hello"}}
@mlin mlin added the interop Bears on spec compatibility label Jul 3, 2024
@github-project-automation github-project-automation bot moved this to Backlog in miniwdl Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Bears on spec compatibility
Projects
Status: Backlog
Development

No branches or pull requests

2 participants