Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Profiles are not guaranteed to succeed even when they have solutions #1543

Open
cdowding-sl opened this issue Nov 14, 2019 · 1 comment
Open
Labels
bug Something isn't working

Comments

@cdowding-sl
Copy link
Contributor

cdowding-sl commented Nov 14, 2019

Bug Report

Steps to Reproduce:

Run

generate --max-rows=1000 --profile-file=C:\src\DataHelix\profile.json

with profile:

{
  "description": "Testing Profile",
  "fields": [
      {
          "name": "a",
          "type": "date",
          "nullable": false
      },
      {
          "name": "b",
          "type": "date",
          "nullable": false
      },
      {
          "name": "c",
          "type": "date",
          "nullable": false
      },
      {
          "name": "d",
          "type": "date",
          "nullable": false
      }
  ],
          "constraints": [
              {
                  "field": "a",
                  "afterField": "b"
              },
              {
                  "field": "b",
                  "afterField": "c"
              },
              {
                  "field": "c",
                  "afterField": "d"
              },
              {
                  "field": "a",
                  "before": "0002-01-01"
              },
              {
                  "field": "b",
                  "before": "0002-01-01"
              },
              {
                  "field": "c",
                  "before": "0002-01-01"
              },
              {
                  "field": "d",
                  "before": "0002-01-01"
              }
          ]
}

Expected Result:

Valid solutions

Actual Result:

Generates a number of rows of data before stopping with error

  • The provided profile is wholly contradictory!

Solution

This occurs because we do not calculate the solution space in its entirety, and instead make some assumptions that we hope are likely to hold true for the solution we are generating. Of course they don't always hold true, leading to an error.

@cdowding-sl cdowding-sl added this to Unprioritised in Version 1 via automation Nov 14, 2019
@Tom-hayden Tom-hayden added the bug Something isn't working label Nov 18, 2019
@Tom-hayden
Copy link
Contributor

This can occur with any profile with "chained" inter-field dependencies where those fields are also restricted by other constraints.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Product roadmap
  
Approved
Version 1
  
Unprioritised
Development

No branches or pull requests

2 participants