vegas-viz / Vegas

The missing MatPlotLib for Scala + Spark
MIT License
730 stars 98 forks source link

sbt mkVegaModel fails #93

Closed DarinJ closed 6 years ago

DarinJ commented 7 years ago

[error] /Users/.../Vegas/spec/src/main/scala/vegas/spec/Spec.scala:5: exception during macro expansion: [error] java.lang.Exception: Input stream is null [error] at argus.schema.Schema$.fromInputStream(Schema.scala:15) [error] at argus.schema.Schema$.fromResource(Schema.scala:25) [error] at argus.macros.SchemaMacros.extractParams(FromSchema.scala:83) [error] at argus.macros.SchemaMacros.fromSchemaMacroImpl(FromSchema.scala:137) [error] @fromSchemaResource("/vega-lite-schema.json", name="Vega", outPath=Some("/Users/.../Vegas/spec/target/scala-2.11/Spec.scala")) [error] ^ [error] one error found [error] (vegaLiteSpec/compile:compileIncremental) Compilation failed [error] Total time: 6 s, completed Jan 23, 2017 3:07:54 PM

Is this still the way to rebuild to spec.scala file? I did change the path to a path on my system vs /Users/afenton/...

oshikiri commented 6 years ago

@aishfenton I met the same error.

Could you provide the procedure for regenerating Spec.scala?

https://github.com/vegas-viz/Vegas/blob/v0.3.11/CONTRIB.md#dev-and-debugging-tips

~TODO: Add Do NOT edit messages~ ~c.f. https://github.com/vegas-viz/Vegas/pull/147#issue-203533092 .~ ~=> https://github.com/vegas-viz/Vegas/pull/152 .~

oshikiri commented 6 years ago

I thought that the following annotation (to Spec.scala) should work, but it still fails with the same error: java.lang.Exception: Input stream is null.

// it still raises "Input stream is null" exception
@fromSchemaResource(
  path = "/spec/src/main/resources/vega-lite-schema.json",
  name = "Vega",
  outPath = Some("spec/target/scala-2.11/Spec.scala")
)

https://github.com/aishfenton/Argus/issues/2 seems to be the cause of this exception.

The following workaround has worked in my environment.

// it usually works, but infrequently fails...
@fromSchemaURL(
  url = "https://vega.github.io/schema/vega-lite/v1.2.0.json",
  name = "Vega",
  outPath = Some("spec/target/scala-2.11/Spec.scala")
)