DOI-USGS / mda.streams

backend tools for powstreams
Creative Commons Zero v1.0 Universal
3 stars 8 forks source link

post_metab_run is broken #245

Closed aappling-usgs closed 8 years ago

aappling-usgs commented 8 years ago

a run gets posted, but a single config gets posted twice, and the identifiers don't get attached. i wonder if this gets to my recent changes to locate_metab_run and all the other locates.

> metab_run_title
[1] "160411 0.0.19 styx_004_sweet_sixteen_ests"
> post_metab_run(folder=dirname(config_path), files=c(basename(cfg_file), "config_metabs.tsv"), on_exists = "addfiles")
creating metab_run item: 160411 0.0.19 styx_004_sweet_sixteen_ests
posting metab_run files: config_metabs.tsv, config_metabs.tsv
adding/replacing identifiers for item 57101309e4b0ef3b7ca358b6: scheme=mda_streams, type=metab_run, key=160411 0.0.19 styx_004_sweet_sixteen_ests
[1] "57101309e4b0ef3b7ca358b6"
Warning messages:
1: In `[<-.factor`(`*tmp*`, iseq, value = "57101309e4b0ef3b7ca358b6") :
  invalid factor level, NA generated
2: In `[<-.factor`(`*tmp*`, iseq, value = "160411 0.0.19 styx_004_sweet_sixteen_ests") :
  invalid factor level, NA generated
3: In repair_metab_run(title, limit = 5000) :
  couldn't find the metab_run item for
160411 0.0.19 styx_004_sweet_sixteen_ests, even searching by dir
> locate_metab_run(metab_run_title, br=T)
[1] <NA>
Levels: 
> post_metab_run(folder=dirname(config_path), files=c(basename(cfg_file), "config_metabs.tsv"), on_exists = "addfiles")
creating metab_run item: 160411 0.0.19 styx_004_sweet_sixteen_ests
posting metab_run files: config_metabs.tsv, config_metabs.tsv
adding/replacing identifiers for item 57101382e4b0ef3b7ca358bb: scheme=mda_streams, type=metab_run, key=160411 0.0.19 styx_004_sweet_sixteen_ests
Error in locate_item(key = title, type = "metab_run", parent = metab_run_folder,  : 
  found more than one match in query for key=160411 0.0.19 styx_004_sweet_sixteen_ests, type=metab_run, parent=55a67ed0e4b0183d66e45d40, title=160411 0.0.19 styx_004_sweet_sixteen_ests
In addition: Warning messages:
1: In `[<-.factor`(`*tmp*`, iseq, value = "57101309e4b0ef3b7ca358b6") :
  invalid factor level, NA generated
2: In `[<-.factor`(`*tmp*`, iseq, value = "160411 0.0.19 styx_004_sweet_sixteen_ests") :
  invalid factor level, NA generated
aappling-usgs commented 8 years ago

oh - well, two files are getting posted because the files argument is receiving rep('config_metabs.tsv',2) in my call to post_metab_run. oops.

aappling-usgs commented 8 years ago

and the bulk of the problem was with locate_item, which was creating data.frames with factors rather than strings.