Skip to content

Title: Vnstock().stock(source=...) causes AttributeError on None symbol #191

@code4funvn

Description

@code4funvn

When using:

from vnstock import Vnstock
stock = Vnstock().stock(source='VCI')
It crashes with:

AttributeError: 'NoneType' object has no attribute 'upper'
Because symbol is None and passed into get_asset_type() without validation.

Please either:

Update the docs to require symbol explicitly, or

Default symbol to empty string, or

Raise ValueError("symbol must not be None") earlier for clarity

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementWorth fixing to enhance the user's experience

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions