Skip to content

fix(drivers-vector-store-astradb): pass correct client parameters #1907

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

Merged
merged 1 commit into from
Apr 24, 2025

Conversation

collindutter
Copy link
Member

Describe your changes

Pass correct parameters after updating to astrapy@2.

Issue ticket number and link

Integration tests:

python_file = 'docs/recipes/src/query_webpage_astra_db_1.py'

    @pytest.mark.parametrize("python_file", discover_python_files("docs"))
    def test_python_file_execution(python_file):
        """Run each Python file using Poetry. If it executes successfully, copy the logs to /tmp/logs."""
        result = subprocess.run(
            ["uv", "run", "python", python_file],
            capture_output=True,
            text=True,
            input="Hi\nexit\n",
            check=False,
        )
    
>       assert result.returncode == 0
E       assert 1 == 0
E        +  where 1 = CompletedProcess(args=['uv', 'run', 'python', 'docs/recipes/src/query_webpage_astra_db_1.py'], returncode=1, stdout=''...onal_dependency("astrapy").DataAPIClient(\nTypeError: __init__() got an unexpected keyword argument \'caller_name\'\n').returncode

tests/integration/test_code_blocks.py:54: AssertionError
_ test_python_file_execution[docs/***-framework/drivers/src/***_store_drivers_11.py] _
[gw0] linux -- Python 3.9.22 /home/runner/work/***/***/.venv/bin/python

python_file = 'docs/***-framework/drivers/src/***_store_drivers_11.py'

    @pytest.mark.parametrize("python_file", discover_python_files("docs"))
    def test_python_file_execution(python_file):
        """Run each Python file using Poetry. If it executes successfully, copy the logs to /tmp/logs."""
        result = subprocess.run(
            ["uv", "run", "python", python_file],
            capture_output=True,
            text=True,
            input="Hi\nexit\n",
            check=False,
        )
    
>       assert result.returncode == 0
E       assert 1 == 0
E        +  where 1 = CompletedProcess(args=['uv', 'run', 'python', 'docs/***-framework/drivers/src/***_store_drivers_11.py'], retur...onal_dependency("astrapy").DataAPIClient(\nTypeError: __init__() got an unexpected keyword argument \'caller_name\'\n').returncode

@collindutter collindutter requested a review from vachillo April 23, 2025 21:52
@collindutter collindutter self-assigned this Apr 23, 2025
Comment on lines -52 to -54
return import_optional_dependency("astrapy").DataAPIClient(
caller_name=self.caller_name,
environment=self.environment,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just dawned on me that import_optional_dependency shouldn't be required in these type of situations

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the extra will have to be installed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gah I completely forgot about the error message component of this. I thought it was just for lazy loading. Will revert :(

@collindutter collindutter merged commit b961a1e into main Apr 24, 2025
15 of 16 checks passed
@collindutter collindutter deleted the fix/astra branch April 24, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants