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

generateCsv() doesn't work with plain object rows. #582

Open
mikelehen opened this issue Feb 2, 2023 · 0 comments
Open

generateCsv() doesn't work with plain object rows. #582

mikelehen opened this issue Feb 2, 2023 · 0 comments
Labels
metrics packages A task for act-now-packages repo
Milestone

Comments

@mikelehen
Copy link
Contributor

I created a row interface:

interface ResultRow {
  year: number;
  regionId: string;
  variable: string;
  value: number;
}

And then tried to use it with generateCsv():

const rows: ResultRow[] = [];
generateCsv(rows);

But I get:

Argument of type 'ResultRow[]' is not assignable to parameter of type 'DataRow[]'.
Type 'ResultRow' is not assignable to type 'DataRow'.
Index signature for type 'string' is missing in type 'ResultRow'.ts(2345)

I think we should try to tweak the types to try to make this work...

@mikelehen mikelehen added packages A task for act-now-packages repo metrics labels Feb 2, 2023
@mikelehen mikelehen added this to the post-launch milestone Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metrics packages A task for act-now-packages repo
Projects
None yet
Development

No branches or pull requests

1 participant