Spaces:
Sleeping
Sleeping
Update prompt
Browse files
prompt.py
CHANGED
|
@@ -75,7 +75,7 @@ You will be provided with the first few rows of data below that represents the d
|
|
| 75 |
Follow this process:
|
| 76 |
|
| 77 |
1. **Observe the sample data.**
|
| 78 |
-
2. Observe description and create a valid
|
| 79 |
|
| 80 |
Here are the valid **Pandera** Checks that you can use:
|
| 81 |
1. 'pa.Check.between(min_value, max_value, include_min=True, include_max=True, **kwargs)'
|
|
@@ -101,20 +101,19 @@ Follow this process:
|
|
| 101 |
21. 'pa.Check.str_startswith(string, **kwargs)' Checks if a string starts with the specified substring.
|
| 102 |
22. 'pa.Check.unique_values_eq(values, **kwargs)' Checks if the unique values in a column are equal to the specified set of values.
|
| 103 |
23. 'pa.Check(lambda x: x )' with lambda functions for custom logic.
|
| 104 |
-
|
| 105 |
-
**ALWAY USE THE COMPLETE PANDERA SYNTAX
|
| 106 |
|
| 107 |
3. For each column, generate a **column name**, **rule name**, and a **Pandera rule** based on the user’s description. Example structure:
|
| 108 |
|
| 109 |
```json
|
| 110 |
[
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
]
|
| 117 |
-
|
| 118 |
4. Repeat this process for a maximum of 5 columns or based on user input. Group all the rules into a single JSON object and return it.
|
| 119 |
IMPORTANT: You should only generate rules based on the user’s input for each column. Return the final rules as a single JSON object, ensuring that the user's instructions are reflected in the validations.
|
| 120 |
|
|
|
|
| 75 |
Follow this process:
|
| 76 |
|
| 77 |
1. **Observe the sample data.**
|
| 78 |
+
2. Observe description and create a valid check
|
| 79 |
|
| 80 |
Here are the valid **Pandera** Checks that you can use:
|
| 81 |
1. 'pa.Check.between(min_value, max_value, include_min=True, include_max=True, **kwargs)'
|
|
|
|
| 101 |
21. 'pa.Check.str_startswith(string, **kwargs)' Checks if a string starts with the specified substring.
|
| 102 |
22. 'pa.Check.unique_values_eq(values, **kwargs)' Checks if the unique values in a column are equal to the specified set of values.
|
| 103 |
23. 'pa.Check(lambda x: x )' with lambda functions for custom logic.
|
| 104 |
+
**ALWAY USE THE COMPLETE PANDERA SYNTAX**
|
|
|
|
| 105 |
|
| 106 |
3. For each column, generate a **column name**, **rule name**, and a **Pandera rule** based on the user’s description. Example structure:
|
| 107 |
|
| 108 |
```json
|
| 109 |
[
|
| 110 |
+
{
|
| 111 |
+
"column_name": "unique_key",
|
| 112 |
+
"rule_name": "Unique Identifiers",
|
| 113 |
+
"pandera_rule": "pa.Column(int, nullable=False, unique=True, name='unique_key')"
|
| 114 |
+
}
|
| 115 |
]
|
| 116 |
+
|
| 117 |
4. Repeat this process for a maximum of 5 columns or based on user input. Group all the rules into a single JSON object and return it.
|
| 118 |
IMPORTANT: You should only generate rules based on the user’s input for each column. Return the final rules as a single JSON object, ensuring that the user's instructions are reflected in the validations.
|
| 119 |
|