# Breaking Changes

# Introduction

Below is a list of breaking changes to the way python components are defined in Flow 5.5 vs Flow 6.0. To bring a Flow 5.5 component over into a Flow 6.0 or later environment the following changes will need to be made in order for the component to be detected when the library is loaded. If you require help to make these changes, please reach out to TEC through your usual support channels.

# Port Definitions

  • definition = Definition(...) has been replaced by ports = Ports(...).
  • Defining ports via a dictionary has been removed. Using the Ports class is mandatory.

# Changes to Both Port Definitions

  • Inports and Outports can be added to Ports using the add_inport and add_outport methods respectively.
  • [None] is no longer accepted as a port type. This has been replaced by the ALL_FLOW_TYPES. If you think you have a need to use this to convert over your component, please reach out to us for guidance.

# Changes to Inport Definitions

  • multi_connection renamed to array and is now False by default.
  • required has been removed and replaced with default, which takes a default value for the port if it is not connected.
    • If default is not set, the port will be required - this is the standard behaviour
    • If array is false, default must be a single flow type value
    • If array is true, default must be a list of flow type values
    • If the port should be optional, but doesn't need a default value (the component should do different things if the port is connected and unconnected), specify the default as base.Null().

# Changes to Outport Definitions

  • Both required and multi_connection have been removed. Outports are always optional and multi-connection.
  • Only id and types can now be set for an outport.

# Process

  • def process(component: Component) should now be def process(component: Process).
  • is_connected has been removed.
    • Optional ports should have a default value specified, so even if they are unconnected they will have data. As such this function is obsolete.
    • If you still want to determine if an optional port is connected, set its default value to base.Null() and following a call to get_data on the port, use the is_null method (or isinstance(value, base.Null)).
  • component.log is now an async function. This means it will not work outside of an async process and must be used with the await keyword. component.log should generally not be used, but if you think you have a need for this please reach out for guidance.
  • run_blocking can now be imported from flow.utils.