Skip to main content

Validation Errors

Validation errors occur when there are semantic errors. Such an something being an array when it should be an object. These types of errors tend to be introduced outside of Coalesce.

When you get a validation error, the Coalesce App will open a drawer showing a list of where the errors are occurring in your repository. You can resolve them by going to the repository and fixing the errors listed.

A validation error showing an object when an array is expected

Reading a YAML File

It's important to understand how to read a YAML(.yml) before solving errors.

When reading a YAML file, Coalesce will use dot notation like operation.dataset or operation.metadata.columns.0.acceptedValues.values, the notation refers to specific paths within the hierarchical structure of the YAML file.

YAML File Example
fileVersion: 1
id: 45ef876a-91d8-4db3-8bc6-27d96889be53
name: LINEITEM
operation: <------
database: ""
dataset: [] <----- operation.dataset
deployEnabled: true
description: Lineitem data as defined by TPC-H
locationName: SAMPLE
metadata: <---------
columns: <--------
- acceptedValues: <-------
strictMatch: true
values: {} <-------- operation.metadata.columns.0.acceptedValues.values
appliedColumnTests: {}
columnReference:
columnCounter: e9ea1254-edec-460e-895c-c3439fcf6b51
stepCounter: 45ef876a-91d8-4db3-8bc6-27d96889be53
config: {}

  • operation.dataset: This refers to the dataset key under the operation section. In this example, dataset is an empty list ([]).
  • operation.metadata.columns.0.acceptedValues.values: operation.metadata refers to the metadata section within operation.
    • columns.0 indicates the first item in the columns list (index 0).
    • acceptedValues.values refers to the values key within acceptedValues. In this example, this is an empty dictionary ({}).

Solving Validation Errors

Using the example again, let's solve these errors.

These examples use GitHub, but can be applied to any Git provider.

The image shows a Repository Validation Error message from Coalesce, indicating that syncing the local branch with the main branch failed due to validation issues in some files. The errors are highlighted under the LINEITEM node, where the operation.dataset is expected to be a string but received an array, and the operation.metadata.columns.0.acceptedValues.values is expected to be an array but received an object.

We can see that there are two errors in the LINEITEM node.

  1. operation.dataset Expected string, received array
  2. operation.metadata.columns.0.acceptedValues.values Expected array, received object.

The errors tell you where the issue is occurring and the data type it expects.

For the first error:operation.dataset Expected string, received array. In GitHub, go to the node and review the file. The first part of the error operation points to the operation on line 4, then within operation, the second part, dataset, points to line 6. Finally, the message, Expected string, received array, means that the array [] should be changed to a string value, or "".

The image shows a portion of a YAML file with a focus on the LINEITEM node. The operation field is highlighted, with the dataset field currently set as an empty array, which should be a string according to the validation error. Additionally, the values field under acceptedValues is set as an empty object, which should be an array.

The second error: operation.metadata.columns.0.acceptedValues.values Expected array, received object. In GitHub, go the node and review the file. Starting in operation on line 4, then metadata on line 10, then columns on line 11, then acceptedValues, and then values on line 14. You can see the value is an empty object, {} and it should be changed to an array, [].

The image displays a YAML file focusing on the LINEITEM node, where several fields are highlighted. The operation field shows the dataset set as an empty array, which should be a string. The metadata field highlights the acceptedValues under columns, where the values field is set as an empty object, which should be an array. These issues correspond to the validation errors previously shown.

Protected File Paths

In Coalesce, certain file paths are protected and should not be modified directly by users. These files are critical to the system’s operation, and altering them can lead to unexpected behavior or errors. The protected file paths are:

./environments/*
./jobs/*
./macros/*
./nodeTypes/*
./nodes/*
./subgraphs/*
./data.yml
./locations.yml
./packagesV1.yml

Attempting to modify these files directly can result in validation errors or system instability.

The image shows a user interface of a version control system displaying a commit panel. A red error message states, Found 3 validation failure(s) for CoalesceRepo.

Understanding Protected Files

Protected files contain essential configurations, definitions, and metadata that Coalesce relies on for proper functioning. For example:

  • Nodes and Node Types (./nodes/*, ./nodeTypes/*): Define the structure and behavior of data transformations.
  • Macros (./macros/*): Contain reusable code snippets or functions.
  • Environments and Locations (./environments/*, ./locations.yml): Specify different runtime environments and data locations.
  • Jobs and Subgraphs (./jobs/*, ./subgraphs/*): Define job sequences and data processing workflows.
  • Configuration Files (./data.yml, ./packagesV1.yml): Hold global settings and package information.

If you encounter validation errors due to modifications of protected file paths:

  1. Do Not Edit Protected Files Directly: Refrain from making manual changes to the files listed above.
  2. Revert Unauthorized Changes: If changes were made, revert them to the original state from the repository’s history.
  3. Use the Coalesce Interface: Make any necessary changes through the Coalesce application, which ensures that modifications comply with system requirements.
  4. Consult Documentation: Refer to specific sections of the documentation for guidance on how to perform desired actions without altering protected files.
  5. Contact Support: If you’re unsure how to proceed, reach out to the Coalesce support team for assistance.