1- defmodule Transport.IRVE.SimpleConsolidation do
1+ defmodule Transport.IRVE.Consolidation do
22 @ moduledoc """
33 This module:
44 - takes the list of relevant IRVE resources from data.gouv.fr,
@@ -38,7 +38,7 @@ defmodule Transport.IRVE.SimpleConsolidation do
3838 # If a task times out, we get {:exit, :timeout} instead of {:ok, result} and the following line will crash.
3939 # This is intentional, we want to be aware of such timeouts.
4040 |> Stream . map ( fn { :ok , result } -> result end )
41- |> Stream . map ( & Transport.IRVE.SimpleReportItem . from_result / 1 )
41+ |> Stream . map ( & Transport.IRVE.ReportItem . from_result / 1 )
4242 |> maybe_log_items ( debug )
4343 |> Enum . into ( [ ] )
4444
@@ -54,7 +54,7 @@ defmodule Transport.IRVE.SimpleConsolidation do
5454
5555 write_consolidated_file ( consolidated_df , @ consolidated_file_base_name , destination )
5656
57- Logger . info ( "IRVE simple consolidation process completed." )
57+ Logger . info ( "IRVE consolidation process completed." )
5858 { :ok , report }
5959 end
6060
@@ -75,7 +75,7 @@ defmodule Transport.IRVE.SimpleConsolidation do
7575
7676 def resource_list do
7777 Transport.IRVE.Extractor . datagouv_resources ( )
78- |> Transport.IRVE.RawStaticConsolidation . exclude_irrelevant_resources ( )
78+ |> Transport.IRVE.Extractor . exclude_irrelevant_resources ( )
7979 |> Enum . sort_by ( fn r -> [ r . dataset_id , r . resource_id ] end )
8080 end
8181
@@ -114,7 +114,7 @@ defmodule Transport.IRVE.SimpleConsolidation do
114114 # it’s not linked to the file content/format, but to how it is published on data.gouv.fr.
115115 # it is done after downloading the file in order to be able to report on the potential
116116 # loss of PDC count.
117- Transport.IRVE.RawStaticConsolidation . ensure_producer_is_org! ( resource )
117+ ensure_producer_is_org! ( resource )
118118
119119 validation_result = Transport.IRVE.Validator . validate ( path , extension )
120120 file_valid? = validation_result |> Transport.IRVE.Validator . full_file_valid? ( )
@@ -134,7 +134,7 @@ defmodule Transport.IRVE.SimpleConsolidation do
134134 def generate_report ( report_rows , destination: destination ) do
135135 report_df =
136136 report_rows
137- |> Enum . map ( & Transport.IRVE.SimpleReportItem . to_map / 1 )
137+ |> Enum . map ( & Transport.IRVE.ReportItem . to_map / 1 )
138138 |> Explorer.DataFrame . new ( )
139139 # `select` orders columns in the provided order
140140 # (https://github.com/elixir-explorer/explorer/issues/1126)
@@ -231,4 +231,8 @@ defmodule Transport.IRVE.SimpleConsolidation do
231231 raise "Error processing resource (#{ resource_id } ) (http_status=#{ status } )"
232232 end
233233 end
234+
235+ defp ensure_producer_is_org! ( % { dataset_organisation_id: "???" } ) , do: raise ( "producer is not an organization" )
236+
237+ defp ensure_producer_is_org! ( _row ) , do: :ok
234238end
0 commit comments