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

Support multiple data type #173

Closed
anjankarpak96 opened this issue Aug 27, 2020 · 1 comment
Closed

Support multiple data type #173

anjankarpak96 opened this issue Aug 27, 2020 · 1 comment

Comments

@anjankarpak96
Copy link

Environment

I am running PyKwalify on my Python file in PyCharm. I am using PyKwalify to validate my yaml file and then run the SQL scripts in Snowflake.

  • Python version: 3.8
  • PyKwalify version: 1.7.0

Steps to Reproduce

I want the schema to support multiple data types. My schema object should accept a string as well a list.

Schema

- Schemas:
            - TPCH_SF001
          ObjType:
            - TABLES
            - VIEWS
- Schemas:
             - TPCDS_SF10TCL
          ObjType: all

Data

                                       type: map
                                          matching-rule: 'any'
                                          mapping:
                                            type: seq
                                            sequence:
                                              - type: str
                                            type: map
                                            mapping:
                                              type: str
                                              enum: ['all']

Expected Behavior

The schema should accept both list and string data type. The only string value is 'all'.

Observed Behavior

It throws an error showing that the YAML file doesn't support duplicate keys.

@Grokzen
Copy link
Owner

Grokzen commented Sep 12, 2021

This basicaly falls in under the existing request #112 which would implement basically the same kind of logic where you can define multiple paths for a single validation. There are plans for implementing this but not in the short term at least. Probably for version 2.0 this will be included.

@Grokzen Grokzen closed this as completed Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants