updates needed for new jsonschema

Bug #1983412 reported by Corey Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
taskflow
Fix Released
Undecided
Unassigned

Bug Description

tox -e py310 results in failures such as:

Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/tmp/taskflow/taskflow/engines/worker_based/worker.py", line 134, in run
    self._server.start()
  File "/tmp/taskflow/taskflow/engines/worker_based/server.py", line 255, in start
    self._proxy.start()
  File "/tmp/taskflow/taskflow/engines/worker_based/proxy.py", line 218, in start
    safe_drain(conn, self._drain_events_timeout)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/connection.py", line 523, in _ensured
    return fun(*args, **kwargs)
  File "/tmp/taskflow/taskflow/engines/worker_based/proxy.py", line 198, in _drain
    conn.drain_events(timeout=timeout)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/connection.py", line 316, in drain_events
    return self.transport.drain_events(self.connection, **kwargs)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/transport/virtual/base.py", line 971, in drain_events
    get(self._deliver, timeout=timeout)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/utils/scheduling.py", line 52, in get
    return self.fun(resource, callback, **kwargs)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/transport/virtual/base.py", line 1009, in _drain_channel
    return channel.drain_events(callback=callback, timeout=timeout)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/transport/virtual/base.py", line 736, in drain_events
    return self._poll(self.cycle, callback, timeout=timeout)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/transport/virtual/base.py", line 400, in _poll
    return cycle.get(callback)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/utils/scheduling.py", line 52, in get
    return self.fun(resource, callback, **kwargs)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/transport/virtual/base.py", line 404, in _get_and_deliver
    callback(message, queue)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/transport/virtual/base.py", line 991, in _deliver
    callback(message)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/transport/virtual/base.py", line 624, in _callback
    return callback(message)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/messaging.py", line 626, in _receive_callback
    return on_m(message) if on_m else self.receive(decoded, message)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/messaging.py", line 592, in receive
    [callback(body, message) for callback in callbacks]
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/kombu/messaging.py", line 592, in <listcomp>
    [callback(body, message) for callback in callbacks]
  File "/tmp/taskflow/taskflow/engines/worker_based/dispatcher.py", line 167, in on_message
    self._process_message(data, message, message_type)
  File "/tmp/taskflow/taskflow/engines/worker_based/dispatcher.py", line 134, in _process_message
    handler.validator(data)
  File "/tmp/taskflow/taskflow/engines/worker_based/protocol.py", line 218, in validate
    su.schema_validate(data, schema)
  File "/tmp/taskflow/taskflow/utils/schema_utils.py", line 34, in schema_validate
    jsonschema.validate(data, schema, types=_SCHEMA_TYPES)
  File "/tmp/taskflow/.tox/py310/lib/python3.10/site-packages/jsonschema/validators.py", line 1056, in validate
    validator = cls(schema, *args, **kwargs)
TypeError: create.<locals>.Validator.__init__() got an unexpected keyword argument 'types'

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to taskflow (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/taskflow/+/851929

Changed in taskflow:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to taskflow (master)

Reviewed: https://review.opendev.org/c/openstack/taskflow/+/851929
Committed: https://opendev.org/openstack/taskflow/commit/4bd0ab33272064cc4e44fe2d652ecf7a11b07274
Submitter: "Zuul (22348)"
Branch: master

commit 4bd0ab33272064cc4e44fe2d652ecf7a11b07274
Author: Corey Bryant <email address hidden>
Date: Tue Aug 2 16:07:04 2022 -0400

    Adapt to new jsonschema versions

    This change provides fixes that were dectected by unit
    test failures with new jsonschema (and py310).

    The types argument has been removed in favor of providing a
    type_checker to jsonschema.validators.extend:
    https://github.com/python-jsonschema/jsonschema/issues/577

    Closes-Bug: #1983412
    Change-Id: I86f12b3d264320308e7f4841910fc21a6e8b3fa9

Changed in taskflow:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/taskflow 5.1.0

This issue was fixed in the openstack/taskflow 5.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.