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

Is it possible to use conditions and constraints in multi table? #637

Closed
Puspak64 opened this issue Nov 16, 2021 · 2 comments
Closed

Is it possible to use conditions and constraints in multi table? #637

Puspak64 opened this issue Nov 16, 2021 · 2 comments
Labels
data:multi-table Related to multi-table, relational datasets feature:constraints Related to inputting rules or business logic question General question about the software

Comments

@Puspak64
Copy link

Environment details

If you are already running SDV, please indicate the following details about the environment in
which you are running it:

  • SDV version: 0.12.0
  • Python version: 3.8
  • Operating System: Windows

Problem description

I want to put some conditions or constraints in one of the table in multi-table evaluation. I have pasted the json format where i have put condition in bold in user table json. Is there any way to achieve the same since we are doing it for the single table?

{
"tables": {
"users": {
"fields": {
"user_id": {
"type": "id",
"subtype": "integer"
},
"country": {
"type": "categorical"
},
"gender": {
"type": "categorical"
},
"age": {
"type": "numerical",
"subtype": "integer"
}
},
"primary_key": "user_id",
"conditions":{"age" : 20}
},
"sessions": {
"fields": {
"session_id": {
"type": "id",
"subtype": "integer"
},
"user_id": {
"type": "id",
"subtype": "integer",
"ref": {
"table": "users",
"field": "user_id"
}
},
"device": {
"type": "categorical"
},
"os": {
"type": "categorical"
},
"minutes": {
"type": "numerical",
"subtype": "integer"
}
},
"primary_key": "session_id"
},
}
}

@Puspak64 Puspak64 added pending review question General question about the software labels Nov 16, 2021
@katxiao katxiao added feature:constraints Related to inputting rules or business logic data:multi-table Related to multi-table, relational datasets labels Nov 18, 2021
@katxiao
Copy link
Contributor

katxiao commented Dec 8, 2021

Hi @Puspak64, thanks for your question. We are tracking the issue of passing tabular constraints to HMA1 here. You can also find a workaround in the linked issue.

We don't currently support using conditions with multi-table, but are planning on adding that through conditional sampling, similar to what is currently supported in our single table models. We will track this feature request here.

@katxiao
Copy link
Contributor

katxiao commented Dec 9, 2021

I'm going to close out this issue in favor of the other two issues that are linked in my above comment. Please feel free to track the multi-table conditional sampling and constraint functionality there!

@katxiao katxiao closed this as completed Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:multi-table Related to multi-table, relational datasets feature:constraints Related to inputting rules or business logic question General question about the software
Projects
None yet
Development

No branches or pull requests

2 participants