port-labs / ocean

🌊 Ocean 🌊 is an innovative solution developed by Port to seamlessly integrate various third-party systems with our developer portal product, empowering engineers to effortlessly prioritize key features and streamline the integration process.
https://ocean.getport.io
Apache License 2.0
109 stars 39 forks source link

[Core] Fix unpacking issue in unregister raw function #870

Closed mk-armah closed 1 month ago

mk-armah commented 1 month ago

Description

Fix unpacking error in unregister raw:

What - Resolved an issue in the unregister_raw method where an incorrect unpacking operation was causing a ValueError ("not enough values to unpack (expected 2, got 1)").

Why - This error occurred because the method was incorrectly expecting a tuple of entities and errors from the asyncio.gather call, but only receiving a single list due to the absence of zip unpacking.

How -The fix involved using zip to correctly unpack the results into entities and errors, and then flattening these lists to handle multiple resource mappings properly. This change ensures that the method correctly processes the output of the asynchronous tasks and handles errors appropriately.

Type of change

Please leave one option from the following and delete the rest:

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.