# Could not find local file-backed GX project

**URL:** <https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961>\
**Category:** GX Core Support\
**Created:** [October 23, 2024, 2:23pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961 "2024-10-23T14:23:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pythons](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@pythons](https://discourse.greatexpectations.io/u/pythons)\
**Post date:** [October 23, 2024, 2:23pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/1 "2024-10-23T14:23:25Z")

</div>

I am using the latest version of GX. Im unable to generate the report. The generated file is empty.

INFO:great\_expectations.data\_context.data\_context.context\_factory:Could not find local file-backed GX project  
INFO:great\_expectations.data\_context.types.base:Created temporary directory ‘C:\Users\*\*\*\*\*\AppData\Local\Temp\tmpv95zw91s’ for ephemeral docs site

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/d5fb782a7719ed909b7226f25795cb7d01c6f952.png)

---

<div class="post-metadata">

**Author:** ![adeola](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@adeola](https://discourse.greatexpectations.io/u/adeola)\
**Post date:** [October 23, 2024, 3:00pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/2 "2024-10-23T15:00:27Z")

</div>

hello @pythons! without providing any environment information, code, or virtually anything, i am not sure how i can help.

---

<div class="post-metadata">

**Author:** ![pythons](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@pythons](https://discourse.greatexpectations.io/u/pythons)\
**Post date:** [October 23, 2024, 3:14pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/3 "2024-10-23T15:14:39Z")

</div>

This is my code. May i know what other details are needed? thank you

# Initialize Base instance

base = Base()

# Define index value

index\_value = 0  
source = base.query\_tables(‘Raw\_Data’, ‘dev’, ‘DB’)

destination = base.query\_tables(‘master’, ‘dev’, ‘DB’)

# Extract relevant data from source

taxsource = source[‘TaxIdentificationNumber’].iloc[index\_value]

firstgroup = str(source[‘GroupName’].iloc[index\_value]).upper()

firstlast = str(source[‘ProviderLastName’].iloc[index\_value]).upper()

firstaddress = str(source[‘ProviderAddress1’].iloc[index\_value]).upper()[:4]

# Debug output

print(firstaddress)

print(type(firstaddress))

print(taxsource)

# Extract relevant data from destination

tax = destination[‘TaxID’]

totid = destination[

(tax == taxsource) &

(destination[‘Hospital\_N’] == firstgroup) &

(destination[‘Last’] == firstlast) &

(destination[‘Address’].str.startswith(firstaddress))

]

firstID = totid[‘Tothpdpyid’].iloc[index\_value]

firsttax = totid[‘TaxID’].iloc[index\_value]

print(firsttax)

# Create a DataFrame to merge

merge\_data = pd.DataFrame({‘TaxIdentificationNumber’: [taxsource], ‘TaxID’: [firsttax]})

print(merge\_data)

# Set up Great Expectations context

context = gx.get\_context()

print(type(context). **name** )

data\_source = context.data\_sources.add\_pandas(‘totid’)

data\_asset = data\_source.add\_dataframe\_asset(name=“pd dataframe asset”)

batch\_definition = data\_asset.add\_batch\_definition\_whole\_dataframe(“batch definition”)

batch = batch\_definition.get\_batch(batch\_parameters={“dataframe”: merge\_data})

# Define and validate expectations

great\_expectation = gx.expectations.ExpectColumnPairValuesToBeEqual(

column\_A=“TaxIdentificationNumber”,

column\_B=“TaxID”

)

validation\_results = batch.validate(great\_expectation)

print(validation\_results)

# checkpoint\_result = validation\_results.run()

# context.view\_validation\_result(checkpoint\_result)

context.build\_data\_docs()

---

<div class="post-metadata">

**Author:** ![adeola](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@adeola](https://discourse.greatexpectations.io/u/adeola)\
**Post date:** [October 23, 2024, 3:43pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/4 "2024-10-23T15:43:11Z")

</div>

are you successfully seeing the validation results? data docs requires a [checkpoint](https://docs.greatexpectations.io/docs/core/trigger_actions_based_on_results/create_a_checkpoint_with_actions) be correctly set up and i think that is why you arent seeing anything in data docs. the quickstart you followed is more of a quick proof of concept and a checkpoint is a more production ready aspect of GX.

Here is how we define a a checkpoint: **Checkpoint** is the primary means for validating data in a production deployment of GX. Checkpoints enable you to run a list of Validation Definitions with shared parameters. Checkpoints can be configured to run Actions, and can pass Validation Results to a list of predefined Actions for processing.

adjusting your code to include a checkpoint should result in data docs correctly generating

---

<div class="post-metadata">

**Author:** ![pythons](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@pythons](https://discourse.greatexpectations.io/u/pythons)\
**Post date:** [October 23, 2024, 4:40pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/5 "2024-10-23T16:40:45Z")

</div>

can you share a link wherein i can follow on how i can add the checkpoint if im using a data frame?I found the one below but i believe this is for SQL?

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/b59d744024e008aeb2969dac6f7d6988cd1ccd5e.png)

---

<div class="post-metadata">

**Author:** ![adeola](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@adeola](https://discourse.greatexpectations.io/u/adeola)\
**Post date:** [October 23, 2024, 5:57pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/6 "2024-10-23T17:57:27Z")

</div>

[create a checkpoint](https://docs.greatexpectations.io/docs/core/trigger_actions_based_on_results/create_a_checkpoint_with_actions?procedure=sample_code)

[run a checkpoint](https://docs.greatexpectations.io/docs/core/trigger_actions_based_on_results/run_a_checkpoint)

You pass the dataframe as a batch parameter. Example:

`validation_results = checkpoint.run(batch_parameters={"dataframe": pd.DataFrame({"a": [1, 2, 3]})})`

---

<div class="post-metadata">

**Author:** ![pythons](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@pythons](https://discourse.greatexpectations.io/u/pythons)\
**Post date:** [October 25, 2024, 9:53pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/7 "2024-10-25T21:53:46Z")

</div>

I tried to follow it but im stuck with validation definition. I encountered an error while retrieving batch definition.

import great\_expectations as gx

import pandas as pd

from scripts.base import Base

from great\_expectations import expectations as gxe

# Initialize Base instance

base = Base()

# Define index value

index\_value = 0

# Query source and destination tables

source = base.query\_tables(‘Raw\_Data’, ‘ **', '** ’)

destination = base.query\_tables(‘ **', ‘DEV-SQL02’, '** \*’)

# Extract relevant data from source

taxsource = source[‘TaxIdentificationNumber’].iloc[index\_value]

firstgroup = str(source[‘GroupName’].iloc[index\_value]).upper()

firstlast = str(source[‘ProviderLastName’].iloc[index\_value]).upper()

firstaddress = str(source[‘ProviderAddress1’].iloc[index\_value]).upper()[:4]

# Debug output

print(firstaddress)

print(type(firstaddress))

print(taxsource)

# Extract relevant data from destination

tax = destination[‘TaxID’]

totid = destination[

(tax == taxsource) &

(destination[‘Hospital\_N’] == firstgroup) &

(destination[‘Last’] == firstlast) &

(destination[‘Address’].str.startswith(firstaddress))

]

firstID = totid[‘Tothpdpyid’].iloc[index\_value]

firsttax = totid[‘TaxID’].iloc[index\_value]

print(firsttax)

# Create a DataFrame to merge

merge\_data = pd.DataFrame({‘TaxIdentificationNumber’: [taxsource], ‘TaxID’: [firsttax]})

print(merge\_data)

# Set up Great Expectations context

context = gx.get\_context()

print(type(context). **name** )

data\_source = context.data\_sources.add\_pandas(‘totid’)

data\_asset = data\_source.add\_dataframe\_asset(name=“pd dataframe asset”)

batch\_definition = data\_asset.add\_batch\_definition\_whole\_dataframe(“batch definition”)

batch = batch\_definition.get\_batch(batch\_parameters={“dataframe”: merge\_data})

# create expectation suite

suite\_name = “my\_expectation\_suite”

suite = gx.ExpectationSuite(name=suite\_name)

suite = context.suites.add(suite)

existing\_suite\_name = (

“my\_expectation\_suite” # replace this with the name of your Expectation Suite

)

suite = context.suites.get(name=existing\_suite\_name)

# Define and validate expectations

great\_expectation = gx.expectations.ExpectColumnPairValuesToBeEqual(

column\_A=“TaxIdentificationNumber”,

column\_B=“TaxID”

)

suite.add\_expectation(great\_expectation)

great\_expectation.save()

validation\_results = batch.validate(great\_expectation)

print(validation\_results)

# create validation definition

expectation\_suite\_name = “my\_expectation\_suite”

expectation\_suite = context.suites.get(name=expectation\_suite\_name)

#retrieve batch definition

data\_source\_name = “my\_data\_source”

data\_asset\_name = “my\_data\_asset”

batch\_definition\_name = “my\_batch\_definition”

batch\_definition = (

context.data\_sources.get(data\_source\_name)

.get\_asset(data\_asset\_name)

.get\_batch\_definition(batch\_definition\_name)

)

#create validation definition

definition\_name = “my\_validation\_definition”

validation\_definition = gx.ValidationDefinition(

data=batch\_definition, suite=expectation\_suite, name=definition\_name

)

# Save the Validation Definition to your Data Context

validation\_definition = context.validation\_definitions.add(validation\_definition)

validation\_definition\_name = “my\_validation\_definition”

validation\_definition = context.validation\_definitions.get(validation\_definition\_name)

validation\_results = validation\_definition.run()

print(validation\_results)

# # context.build\_data\_docs()

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/c517efc27fb101b94505bfd417e522464dd65793.png)  
Do you know where should the values below will come from?data\_source\_name = “my\_data\_source”  
data\_asset\_name = “my\_data\_asset”  
batch\_definition\_name = “my\_batch\_definition”

---

<div class="post-metadata">

**Author:** ![adeola](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@adeola](https://discourse.greatexpectations.io/u/adeola)\
**Post date:** [October 29, 2024, 7:21pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/8 "2024-10-29T19:21:26Z")

</div>

when you are creating the validation definition you are retrieving a datasource `“my_data_source”` when the name of the data source you created earlier was named `"totid"`

---

<div class="post-metadata">

**Author:** ![pythons](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@pythons](https://discourse.greatexpectations.io/u/pythons)\
**Post date:** [October 29, 2024, 8:30pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/9 "2024-10-29T20:30:20Z")

</div>

Thank you for your response. I did replace my data\_source\_name with totid but now my issue is with the data\_asset\_name. In my code my data asset is ‘data\_asset’ but it seems incorrect. I wonder what should be the right value?

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/75476c1e70084cd70d7ebd0a814cfe3500c5e2c1.png)

---

<div class="post-metadata">

**Author:** ![adeola](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@adeola](https://discourse.greatexpectations.io/u/adeola)\
**Post date:** [October 29, 2024, 8:40pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/10 "2024-10-29T20:40:34Z")

</div>

again, you added the asset:  
`data_asset = data_source.add_dataframe_asset(name=“pd dataframe asset”)`

and then are trying to fetch an asset with a different name. above where you have` batch_definition =` you don’t need to name the data source and asset again, as they already have names, you simply need to fetch them as you are with

```auto
batch_definition = (
.....get())

```

---

<div class="post-metadata">

**Author:** ![pythons](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@pythons](https://discourse.greatexpectations.io/u/pythons)\
**Post date:** [November 1, 2024, 6:44pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/11 "2024-11-01T18:44:53Z")

</div>

I need to update the data\_asset part of my code? What am I going to get then? I just followed the instructions here [Try GX Core | Great Expectations](https://docs.greatexpectations.io/docs/core/introduction/try_gx?procedure=instructions)

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/9dccd9ad317592e5d46c6968d96dcf610285e4a2.png)

---

<div class="post-metadata">

**Author:** ![pythons](https://avatars.discourse-cdn.com/v4/letter/p/c4cdca/32.png) [@pythons](https://discourse.greatexpectations.io/u/pythons)\
**Post date:** [November 7, 2024, 9:39pm UTC](https://discourse.greatexpectations.io/t/could-not-find-local-file-backed-gx-project/1961/12 "2024-11-07T21:39:09Z")

</div>

I was able to generate the report successfully but im wondering why i still have this error

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/greatexpectations/original/1X/12c5ba45aa4c62bb7ed676f09cd1f3531c2c6ef2.png)
