TACTIC Open Source
Error importing CSV - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: Error importing CSV (/showthread.php?tid=60)



Error importing CSV - dankitchen - 12-19-2019

I am using Tactic 4.7.0.b02 and am receiving the following stack trace when trying to import a csv.  Seems to be some sort of issue in the file.  I have attached a 2 line example file that fails for me

[attachment=36]

[b]Error: expected string or bytes-like object[/b]

  File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 5401, in get_widget
    html = widget.get_buffer_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 480, in get_buffer_display
    buffer = self.get_buffer(cls)
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 471, in get_buffer
    self.explicit_display(cls)
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 438, in explicit_display
    widget = child.get_display()
  File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
    super(HtmlElement,self).get_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
    widget.explicit_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
    child = self.get_display()
  File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
    super(HtmlElement,self).get_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
    widget.explicit_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 438, in explicit_display
    widget = child.get_display()
  File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
    super(HtmlElement,self).get_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
    widget.explicit_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 438, in explicit_display
    widget = child.get_display()
  File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
    super(HtmlElement,self).get_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
    widget.explicit_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
    child = self.get_display()
  File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
    super(HtmlElement,self).get_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
    widget.explicit_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
    child = self.get_display()
  File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
    super(HtmlElement,self).get_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
    widget.explicit_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
    child = self.get_display()
  File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
    super(HtmlElement,self).get_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
    widget.explicit_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
    child = self.get_display()
  File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
    super(HtmlElement,self).get_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
    widget.explicit_display()
  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
    child = self.get_display()
  File "/opt/tactic/tactic/src/pyasm/widget/input_wdg.py", line 1508, in get_display
    current_values = self.get_values(for_display=True)
  File "/opt/tactic/tactic/src/pyasm/widget/input_wdg.py", line 442, in get_values
    new_value = NamingUtil.eval_template(value)
  File "/opt/tactic/tactic/src/pyasm/biz/naming.py", line 803, in eval_template
    temp_list = expression.findall(template)



thanks
-Dan


RE: Error importing CSV - Celton McGrath - 12-19-2019

Hi Dan,

Thanks for submitting this bug! The bug is caused my an empty cell in the first non-title row of the csv.

The workaround is to have a dummy row as the first-non title row, or choose a row without an empty cell (ATOM_V41693242)

This bug has probably always been in the CsvImportWdg, which has been around for quite some time!

I'll try to have this fixed in the next version of 4.7.

Best,

Celton


RE: Error importing CSV - dankitchen - 12-19-2019

Hey Celton, that was it :-) I'm surprised I never ran into that bug before. I just in a 0 for that field

thanks
-Dan