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

Flatten Map of Arbitrary Depth #2

Closed
4 tasks done
nelsonic opened this issue Oct 3, 2020 · 2 comments
Closed
4 tasks done

Flatten Map of Arbitrary Depth #2

nelsonic opened this issue Oct 3, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T1h Time Estimate 1 Hour technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

nelsonic commented Oct 3, 2020

I'm having trouble stringifying a Map in auth which results in the following error:

 ** (Protocol.UndefinedError) protocol String.Chars not implemented for 
%{"person" => %{"email" => "alex+43130@gmail.com", "state" => "any"}} of type Map. 
This protocol is implemented for the following type(s): Postgrex.Copy, Postgrex.Query, 
Decimal, Float, DateTime, Time, List, Version.Requirement, Atom, Integer, Version, 
Date, BitString, NaiveDateTime, URI

Instead of extending the Auth.Log.stringify/1 function, it's time to split out another Useful function into our reusable library.

Todo

  • write tests for expected output
  • implement flatten_map/1 function
    • accept map of arbitrary depth/nesting and flatten it to a single level
  • publish new version of package to hex.pm
@nelsonic nelsonic added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed T1h Time Estimate 1 Hour priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished technical A technical issue that requires understanding of the code, infrastructure or dependencies labels Oct 3, 2020
nelsonic added a commit that referenced this issue Oct 4, 2020
@nelsonic
Copy link
Member Author

nelsonic commented Oct 4, 2020

shipped flatten_map/1: https://hexdocs.pm/useful/Useful.html#flatten_map/1

@nelsonic nelsonic closed this as completed Oct 4, 2020
nelsonic added a commit to dwyl/auth that referenced this issue Oct 4, 2020
@nelsonic
Copy link
Member Author

nelsonic commented Oct 4, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T1h Time Estimate 1 Hour technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
None yet
Development

No branches or pull requests

1 participant