Can i use a partition router in version 1.8.5 by u...
# ask-community-for-troubleshooting
p
Can i use a partition router in version 1.8.5 by using custom components - show me
k
Yes, you can use a partition router in Airbyte version 1.8.5 by implementing a custom component. Specifically, you can use the
CustomPartitionRouter
object, which allows you to define partitioning logic in custom Python code. To do this, you need to specify the fully-qualified class name of your custom partition router in the YAML configuration. The format for the class name is
source_<name>.<package>.<class_name>
. Here’s an example from the documentation:
Copy code
yaml partition_router:   type: CustomPartitionRouter   class_name: source_railz.components.MyCustomPartitionRouter
You can also pass parameters to your custom partition router using the
$parameters
field if needed. This approach is supported in Airbyte 1.8.x, as shown in the documentation: > Partition router component whose behavior is derived from a custom code implementation of the connector. > > Properties: > - class_name: Fully-qualified name of the class that will be implementing the custom partition router. The format is
source_<name>.<package>.<class_name>
. > > Example: >
Copy code
> source_railz.components.MyCustomPartitionRouter >
> [CustomPartitionRouter - YAML Reference](https://docs.airbyte.com/platform/1.8/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/CustomPartitionRouter) So, you can indeed use a custom partition router component in Airbyte 1.8.5.
p
@kapa.ai do you have any code example of this implemented
k
A message from kapa.ai
I'm sorry, but the knowledge sources provided do not contain a full code example of a custom partition router implementation in Python. The documentation does show how to reference a custom partition router in your YAML configuration:
Copy code
yaml partition_router:   type: CustomPartitionRouter   class_name: source_railz.components.MyCustomPartitionRouter
However, it does not include the actual Python code for the custom class itself. The documentation only specifies that the class should be fully qualified (e.g.,
source_railz.components.MyCustomPartitionRouter
) and that you can pass parameters using the
$parameters
field if needed [CustomPartitionRouter - YAML Reference](https://docs.airbyte.com/platform/1.8/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/CustomPartitionRouter). If you need to implement a custom partition router, you would need to create a Python class in your connector's codebase, but the exact implementation details are not provided in the available documentation.