-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add 'summary_table_max_rows' configuration option #508
Conversation
@mdavyt92 Does that mean adding a setting called summary_table_max_rows? .. If so, I think the documentation needs to be modified. |
Please also update the change log. |
Updated documentation and changelog. Not sure what to do with the schema |
Is it a character? Is it a number? If it is a number, is there a range that can be set? .. Does that mean that decimal points are not allowed? |
It's a non negative integer. |
The reason why there is no setting. Dunno. I didn't make it. ### summary table
summary_table_fields: {type: array, items: {type: string}}
summary_table_type: {type: string, enum: ['ascii', 'markdown']}
summary_table_max_rows: {type: number}
summary_prefix: {type: string}
summary_suffix: {type: string} |
Is there anything else you care about? |
@mdavyt92 Please add a unit test to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new summary table max rows param!
I made a mistake in pointing out the review. I'm sorry. With the current settings, negative and decimal values are also allowed. Correctly, you need to modify schema.yaml as follows. summary_table_max_rows: {type: number} ↓ summary_table_max_rows: {type: integer, 'minimum': 0} |
Thanks for the heads-up @nsano-rururu. I've pushed the change directly to master: 0ec9179 I don't think the single quotes are required since other schema.yaml lines did not specify |
surely. No single quotes required. We apologize for including unnecessary information. import jsonschema
schema = {
"type" : "object",
"properties" : {
"price" : {"type" : "integer", "minimum": 0},
"name" : {"type" : "string"},
"to" : {"type" : "string", "format": "email"},
"url" : {"type" : "string", "format": "uri"}
},
}
try:
jsonschema.validate(instance={"name" : "1", "price" : 1, "to": "aaa@abc.com", "url" : "100"}, schema=schema, format_checker=jsonschema.FormatChecker())
except Exception as e:
print(e) price is 1
price is -1
price is 0.2
|
Description
There is currently no way of limiting the number of rows in a summary_table. This can lead to very long "summary" tables that can break formatting when sending notifications.
Checklist
make test-docker
with my changes.Questions or Comments
This is a small code change. I've been running this for a few days, there have been no issues.