I'm having some trouble validating a package with primary/foreign key relations - I get the following:
See original GitHub issueI’m having some trouble validating a package with primary/foreign key relations - I get the following:
{
"version": "4.1.0",
"time": 0.036,
"errors": [
{
"code": "task-error",
"name": "Task Error",
"tags": [],
"note": "'str' object has no attribute 'keys'",
"message": "The task has an error: 'str' object has no attribute 'keys'",
"description": "General task-level error."
}
],
"tasks": [],
"stats": {
"errors": 1,
"tasks": 0
},
"valid": false
}
Primary keys and foreign keys seem to be defined ok and I’m at a loss to know what this error means.
The package follows a basic star schema and if I remove the FK relations on the main data table resource the package validates fine. I’ve copied the FK definition which appears at the end of the table resource (I’ve tried the fields both with and without an array - the documentation is a bit confusing, but the result re the error is the same):
"foreignKeys": [
{
"fields": [
"crop_type"
],
"reference": {
"resource": "crop_types_data",
"fields": [
"crop_name"
]
}
},
{
"fields": [
"liming_factor_level"
],
"reference": {
"resource": "liming_factor_data",
"fields": [
"factor_level_name"
]
}
},
{
"fields": [
"p_factor_level"
],
"reference": {
"resource": "p_factor_data",
"fields": [
"factor_level_name"
]
}
},
{
"fields": [
"k_factor_level"
],
"reference": {
"resource": "k_factor_data",
"fields": [
"factor_level_name"
]
}
}
]
Any idea why this is happening?
_Originally posted by @sapetti9 in https://github.com/frictionlessdata/project/discussions/623_
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Error when validating a package with primary/foreign key ...
I'm having some trouble validating a package with primary/foreign key relations - I get the following: { "version": "4.1.0", "time": 0.036, ...
Read more >3 common foreign key mistakes (and how to avoid them)
1. Mismatched data types ... When you're using a foreign key to reference a column in another table, the datatypes of both tables...
Read more >ENABLE NOVALIDATE validating existing data - Ask TOM
This is what i am doing:SQL> create table t (a number, constraint uniq_a ... if the primary key is enabled novalidate - then...
Read more >What's wrong with foreign keys? - Stack Overflow
Reasons to use Foreign Keys: you won't get Orphaned Rows; you can get nice "on delete cascade" behavior, automatically cleaning up tables; knowing...
Read more >The following unsupported foreign key relationships are ...
I would like to start using Memory-Optimized Tables in my OLTP database. I am using Memory Optimization Advisor and getting the following error....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@roll I’ve attached the main data file and a couple of related files - its just a subset of the data as this is to accompany a journal article which hasn’t yet been published.
crop_types_data.csv.txt grain_data.csv.txt mn_factor_data.csv.txt
I’ve improved the error message in
frictionless@4.2.1