gritql
gritql copied to clipboard
Hanging commas after removing kwargs in Python
Continuing from Discord message.
`TaskMetadata($args)` where {
$args <: any {
contains `n_samples=$_` as $ns_kwarg where {
$ns_kwarg <: `n_samples = $ns_val` => .
},
contains keyword_argument(name="avg_character_length") as $avg_kwarg where {
$avg_kwarg <: `avg_character_length = $avg_val` => `stats=GeneralDescriptiveStats(n_samples=$ns_val, avg_character_length=$avg_val)`
},
},
}
from pydantic import BaseModel
class TaskMetadata(BaseModel):
n_samples: dict[str, int]
avg_character_length: dict[str, float]
if __name__ == "__main__":
TaskMetadata(
name="TbilisiCityHallBitextMining",
dataset={
"path": "jupyterjazz/tbilisi-city-hall-titles",
"revision": "798bb599140565cca2dab8473035fa167e5ee602",
},
description="Parallel news titles from the Tbilisi City Hall website (https://tbilisi.gov.ge/).",
type="BitextMining",
category="s2s",
eval_splits=[_EVAL_SPLIT],
eval_langs=_EVAL_LANGS,
main_score="f1",
domains=["News"],
text_creation="created",
n_samples={_EVAL_SPLIT: 1820},
reference="https://huggingface.co/datasets/jupyterjazz/tbilisi-city-hall-titles",
date=("2024-05-02", "2024-05-03"),
form=["written"],
task_subtypes=[],
license="Not specified",
socioeconomic_status="mixed",
annotations_creators="derived",
dialect=[],
bibtex_citation="",
avg_character_length={_EVAL_SPLIT: 78},
)
Morgante suggested it might be a bug somewhere around here.
Results in a dangling comma:
Thanks a ton for the work you do! The DSL is super interesting, albeit/because it is a challenge to wrap my head around. Love it being open source!
Thanks a ton for the work you do! The DSL is super interesting, albeit/because it is a challenge to wrap my head around. Love it being open source!
Thank you! Please also do provide feedback on areas we could improve the documentation for.
For this issue, the fix will involve our comma algorithm. Happy to accept a PR if someone fixes this case.
/bounty $50
💎 $50 bounty • Grit
Steps to solve:
- Start working: Comment
/attempt #416with your implementation plan - Submit work: Create a pull request including
/claim #416in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
Thank you for contributing to getgrit/gritql!
Add a bounty • Share on socials
| Attempt | Started (GMT+0) | Solution |
|---|---|---|
| 🟢 @abhishek818 | Jul 13, 2024, 9:04:54 AM | #418 |
| 🟢 @Alex-ley-scrub | Oct 26, 2024, 10:30:58 PM | #566 |
💡 @abhishek818 submitted a pull request that claims the bounty. You can visit your bounty board to reward.
/attempt #416
| Algora profile | Completed bounties | Tech | Active attempts | Options |
|---|---|---|---|---|
| @abhishek818 | 13 bounties from 6 projects | JavaScript, TypeScript |
Cancel attempt |
/attempt #416
| Algora profile | Completed bounties | Tech | Active attempts | Options |
|---|---|---|---|---|
| @Alex-ley-scrub | 3 grit bounties | Rust |
Cancel attempt |
💡 @Alex-ley-scrub submitted a pull request that claims the bounty. You can visit your bounty board to reward.