Skip to content

fix(go): Refactor mappers to own module - #188

Merged
devsjc merged 3 commits into
mainfrom
devsjc/mappers
Jul 29, 2026
Merged

fix(go): Refactor mappers to own module#188
devsjc merged 3 commits into
mainfrom
devsjc/mappers

Conversation

@devsjc

@devsjc devsjc commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Moves all mapping logic to it's own file, simplifying the logic in the RPC implementations. Also enables testing of the mapping outside of testing business logic.

Contribution Checklist

  • Have you followed the Open Climate Fix Contribution Guidelines?
  • Have you referenced the Issue this PR addresses, where applicable?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added a summary of the changes?
  • Have you written new tests for your changes, where applicable?
  • Have you successfully run make lint with your changes locally?
  • Have you successfully run make test with your changes locally?

Warning

PRs may be closed if all the above boxes are not checked.

devsjc added 2 commits July 29, 2026 02:57
Moves the time window validation, and location uuid validation, to
protovalidate. This prevents the need for some checks within the go
code.
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Benchmark Results

Benchmark results
?   	github.com/openclimatefix/data-platform/cmd	[no test files]
?   	github.com/openclimatefix/data-platform/internal/gen/ocf/dp	[no test files]
?   	github.com/openclimatefix/data-platform/internal/interceptors	[no test files]
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/dummy	0.005s
{"level":"debug","time":"2026-07-29T09:42:01Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	      50	  22904431 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	     180	   6545414 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	     930	   1246732 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	     105	  10990233 ns/op
BenchmarkPostgresClient/small/StreamForecastData-4              	      21	  52534935 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	68.665s
?   	github.com/openclimatefix/data-platform/internal/server/postgres/gen	[no test files]

@devsjc
devsjc merged commit 09e7eae into main Jul 29, 2026
4 checks passed
@devsjc
devsjc deleted the devsjc/mappers branch July 29, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant