IDEA-CR-50936: PY-37063 Check shape attribute

GitOrigin-RevId: 042b70061f8f3b9a063c7c177dea8e43923a016f
This commit is contained in:
Elizaveta Shashkova
2019-08-04 00:03:09 +03:00
committed by intellij-monorepo-bot
parent 6a7141d97b
commit 4be98911ed
@@ -244,8 +244,8 @@ def is_numpy(x):
or 'float' in type_name or 'complex' in type_name
def is_numeric_container(var_type):
return var_type in ("ndarray", "DataFrame", "Series")
def is_numeric_container(var_type, var):
return var_type in ("ndarray", "DataFrame", "Series") and hasattr(var, "shape")
def should_evaluate_full_value(val):
@@ -380,7 +380,7 @@ def var_to_xml(val, name, doTrim=True, additional_in_xml='', evaluate_full_value
else:
xml_value = ''
if is_numeric_container(typeName):
if is_numeric_container(typeName, v):
xml_shape = ' shape="%s"' % make_valid_xml_value(str(v.shape))
else:
xml_shape = ''