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

feat: added the descritpion field to the dataset struct [#DHUB-972] #964

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gtfs2ntfs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gtfs2ntfs"
version = "1.1.0"
version = "1.1.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je crois qu'on augmente plus les versions des crates de transit_model puisqu'on ne les publie pas sur crates.io
Par contre tu dois augmenter la version dans le cargo.toml de la racine en 0.69.0 puisque tu as changé l'API de Dataset

authors = ["Hove <[email protected]>"]
license = "AGPL-3.0-only"
description = "Binary to convert Transit data from GTFS format to NTFS"
Expand Down
8 changes: 7 additions & 1 deletion src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use tracing::info;
#[derive(Deserialize, Debug)]
struct ConfigDataset {
dataset_id: String,
description: Option<String>,
}

#[derive(Deserialize, Debug)]
Expand All @@ -51,6 +52,7 @@ struct Config {
/// },
/// "dataset": {
/// "dataset_id": "dataset-id"
/// "description": "datasource_name"
/// },
/// "feed_infos": {
/// "feed_publisher_name": "The Great Data Publisher",
Expand Down Expand Up @@ -79,7 +81,11 @@ pub fn read_config<P: AsRef<path::Path>>(
let config: Config = serde_json::from_reader(json_config_file)?;

contributor = config.contributor;
dataset = objects::Dataset::new(config.dataset.dataset_id, contributor.id.clone());
dataset = objects::Dataset::new(
config.dataset.dataset_id,
contributor.id.clone(),
config.dataset.description.clone(),
);
if let Some(config_feed_infos) = config.feed_infos {
feed_infos = config_feed_infos;
}
Expand Down
4 changes: 2 additions & 2 deletions src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pub struct Dataset {
}

impl Dataset {
pub fn new(dataset_id: String, contributor_id: String) -> Dataset {
pub fn new(dataset_id: String, contributor_id: String, desc: Option<String>) -> Dataset {
let validity_period = ValidityPeriod::default();

Dataset {
Expand All @@ -253,7 +253,7 @@ impl Dataset {
end_date: validity_period.end_date,
dataset_type: None,
extrapolation: false,
desc: None,
desc,
system: None,
}
}
Expand Down