HumanCellAtlas / ingest-central

Ingest Central is the hub repository for the ingest service
Apache License 2.0
0 stars 1 forks source link

Fix ingest-client code compatibility with PyYaml 5.2 #648

Open aaclan-ebi opened 4 years ago

aaclan-ebi commented 4 years ago

Test is failing when PyYaml 5.2 is being used:


........................................................................................................................................................................................................................E..............
======================================================================
ERROR: test__generate_yaml_full_schema_template__success (tests.template.test_schema_template.TestSchemaTemplate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/HumanCellAtlas/ingest-client/tests/template/test_schema_template.py", line 348, in test__generate_yaml_full_schema_template__success
    self.assertEqual(SortedDict(yaml.load(yaml_representation, Loader=yaml.FullLoader)),
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/yaml/constructor.py", line 43, in get_single_data
    return self.construct_document(node)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/yaml/constructor.py", line 52, in construct_document
    for dummy in generator:
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/yaml/constructor.py", line 404, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/yaml/constructor.py", line 210, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/yaml/constructor.py", line 135, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/yaml/constructor.py", line 92, in construct_object
    data = constructor(self, node)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/yaml/constructor.py", line 420, in construct_undefined
    node.start_mark)
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:collections.OrderedDict'
  in "<unicode string>", line 33, column 23:
        timecourse.value: !!python/object/apply:collection ... 

PyYaml 5.2 was released 2nd Dec 2019, https://pypi.org/project/PyYAML/#history.

Temporarily pinned the version of PyYaml to be equal to 5.1

justincc commented 4 years ago

How long is PyYaml 5.1 supported?

aaclan-ebi commented 4 years ago

It's just a python library. We can still use it as long as we want but if there are issues in that version, fixes will be done on top of the latest version.