You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to avoid problems related to the eventual occurence of circular dependencies, a "hack" was put in place in the get_update_query function of the support/query_utils.py module. Since we need to know what type of entity has been passed to the function as argument (GraphEntity, ProvEntity or MetadataEntity) and at the same time we cannot use the builtin function isinstance (since it would require us to import GraphEntity, ProvEntity and MetadataEntity, leading to circular dependencies), then whoever needs to use this function must do the "isinstance check" and pass to get_update_query a string with one of these values: "graph", "prov" or "metadata".
This is surely not a good design choice and it should be fixed. It should also be investigated if the circular dependency appears only when testing with "poetry run test" (which in turn uses unittest that tries to load every module, and also the __init__.py files that cause the problem). All the internal import statements must always have a full path to the required module, since this ensures that __init__.py files are bypassed. This should avoid circular dependencies at runtime.
The text was updated successfully, but these errors were encountered:
In order to avoid problems related to the eventual occurence of circular dependencies, a "hack" was put in place in the
get_update_query
function of thesupport/query_utils.py
module. Since we need to know what type of entity has been passed to the function as argument (GraphEntity
,ProvEntity
orMetadataEntity
) and at the same time we cannot use the builtin functionisinstance
(since it would require us to importGraphEntity
,ProvEntity
andMetadataEntity
, leading to circular dependencies), then whoever needs to use this function must do the "isinstance check" and pass toget_update_query
a string with one of these values: "graph", "prov" or "metadata".This is surely not a good design choice and it should be fixed. It should also be investigated if the circular dependency appears only when testing with "poetry run test" (which in turn uses
unittest
that tries to load every module, and also the__init__.py
files that cause the problem). All the internal import statements must always have a full path to the required module, since this ensures that__init__.py
files are bypassed. This should avoid circular dependencies at runtime.The text was updated successfully, but these errors were encountered: