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

String indices must be indices error when calling list_active_stores() #9983

Closed
stfines-clgx opened this issue May 28, 2024 · 1 comment
Closed

Comments

@stfines-clgx
Copy link

stfines-clgx commented May 28, 2024

Describe the bug
In attempting to create a dynamically provisioned context for a data validation pipeline, I ran across this error:

Traceback (most recent call last):
  File "/Users/stfines/Library/Caches/pypoetry/virtualenvs/airflow-great-expectations-dag-yAcbwmv7-py3.11/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 3550, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-23-77496d5f7fe7>", line 1, in <module>
    ctx.list_active_stores()
  File "/Users/stfines/Library/Caches/pypoetry/virtualenvs/airflow-great-expectations-dag-yAcbwmv7-py3.11/lib/python3.11/site-packages/great_expectations/data_context/data_context/abstract_data_context.py", line 1221, in list_active_stores
    self.expectations_store_name,  # type: ignore[list-item]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stfines/Library/Caches/pypoetry/virtualenvs/airflow-great-expectations-dag-yAcbwmv7-py3.11/lib/python3.11/site-packages/great_expectations/data_context/data_context/abstract_data_context.py", line 549, in expectations_store_name
    return self.variables.expectations_store_name
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stfines/Library/Caches/pypoetry/virtualenvs/airflow-great-expectations-dag-yAcbwmv7-py3.11/lib/python3.11/site-packages/great_expectations/data_context/data_context_variables.py", line 171, in expectations_store_name
    return self._get(DataContextVariableSchema.EXPECTATIONS_STORE_NAME)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stfines/Library/Caches/pypoetry/virtualenvs/airflow-great-expectations-dag-yAcbwmv7-py3.11/lib/python3.11/site-packages/great_expectations/data_context/data_context_variables.py", line 123, in _get
    val: Any = self.config[key]
               ~~~~~~~~~~~^^^^^
TypeError: string indices must be integers, not 'str'

To Reproduce
Please include your great_expectations.yml config, the code you’re executing that causes the issue, and the full stack trace of any error(s).

Create an empty file context following the tutorial.

use something like this like this to set the active config:

def construct_expectation_store(context, project_name, bucket_name):
    context.set_config("""
    "expectations_store_name": 
            "class_name": "ExpectationsStore"
            "store_backend": 
                "class_name": "TupleGCSStoreBackend"
                "project": "{project_name}"
                "bucket": "{bucket_name}"
                "prefix": "/expectations"
        "validations_store_name": 
            "class_name": "ValidationsStore"
            "store_backend": 
                "class_name": "TupleGCSStoreBackend"
                "project": "{project_name}"
                "bucket": "{bucket_name}"
                "prefix": "/validations"
        "profiler_store_name": 
            "class_name": "ProfilerStore"
            "store_backend": 
                "class_name": "TupleGCSStoreBackend"
                "project": "{project_name}"
                "bucket": "{bucket_name}"
                "prefix": "/profiles"
        "evaluation_parameter_store_name": 
            "class_name": "EvaluationParameterStore"
            "store_backend":
                "class_name": "TupleGCSStoreBackend"
                "project": "{project_name}" 
                "bucket": "{bucket_name}"
                "prefix": "/evaluation_parameters"  
        "checkpoint_store_name":
            "class_name": "CheckpointStore"
            "store_backend":
                "class_name": "TupleGCSStoreBackend"
                "project": "{project_name}"
                "bucket": "{bucket_name}"
                "prefix": "/checkpoints"
        """.format(
            project_name=project_name, bucket_name=bucket_name
        )

then call ctx.list_active_stores()

Expected behavior
I would expect that the store name would be set from the configuration after calling set_config()

Environment (please complete the following information):

  • Operating System: [e.g. Linux, MacOS, Windows]
    MacOs
  • Great Expectations Version: [e.g. 0.13.2]
    18.13
  • Data Source: [e.g. Pandas, Snowflake]
    N/A
  • Cloud environment: [e.g. Airflow, AWS, Azure, Databricks, GCP]
    N/A

Additional context
This was replicated using the python 3.11 repl.

@molliemarie
Copy link
Contributor

Hello @stfines-clgx. With the launch of Great Expectations Core (GX 1.0), we are closing old issues posted regarding previous versions. Moving forward, we will focus our resources on supporting and improving GX Core (version 1.0 and beyond). If you find that an issue you previously reported still exists in GX Core, we encourage you to resubmit it against the new version. With more resources dedicated to community support, we aim to tackle new issues swiftly. For specific details on what is GX-supported vs community-supported, you can reference our integration and support policy.

To get started on your transition to GX Core, check out the GX Core quickstart (click “Full example code” tab to see a code example).

You can also join our upcoming community meeting on August 28th at 9am PT (noon ET / 4pm UTC) for a comprehensive rundown of everything GX Core, plus Q&A as time permits. Go to https://greatexpectations.io/meetup and click “follow calendar” to follow the GX community calendar.

Thank you for being part of the GX community and thank you for submitting this issue. We're excited about this new chapter and look forward to your feedback on GX Core. 🤗

@molliemarie molliemarie closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
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

No branches or pull requests

2 participants