Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hints aren't recursive #119

Open
alexiswl opened this issue Feb 20, 2024 · 1 comment
Open

Type hints aren't recursive #119

alexiswl opened this issue Feb 20, 2024 · 1 comment
Assignees
Labels
help wanted Extra attention is needed

Comments

@alexiswl
Copy link
Contributor

Given a function such as the one below

def get_project_data_obj_by_id(
    project_id: str,
    data_id: str
) -> ProjectData:
    """
    Given a project_id and a data_id, return the data object

    :param project_id:
    :param data_id:

    :return:
    """

    # Get the configuration
    configuration = get_icav2_configuration()

    # Enter a context with an instance of the API client
    with ApiClient(configuration) as api_client:
        # Create an instance of the API class
        api_instance = ProjectDataApi(api_client)

    # example passing only required values which don't have defaults set
    try:
        # Retrieve the list of project data.
        data_obj: ProjectData = api_instance.get_project_data(
            project_id=project_id,
            data_id=data_id
        )
    except ApiException as e:
        logger.error("Exception when calling ProjectDataApi->get_project_data_list: %s\n" % e)
        raise ApiException

    return data_obj

I can call this function to retrieve a project data object.

my_project_data_obj = get_project_data_obj_by_id("my_project_id", "my_data_id")

PyCharm IDE then gives me the following attributes as expected if I was to write my_project_data_obj.

image

However, despite the attribute data being of type Data - see https://umccr-illumina.github.io/libica/openapi/v2/docs/ProjectData/ or screenshot below

image

When I try and perform an action on the attribute, I don't get any helpful suggests, even though libica should know it's of type Data.

image

@alexiswl alexiswl added the help wanted Extra attention is needed label Feb 20, 2024
@victorskl
Copy link
Member

This might be relating to late binding... I will see to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants