Skip to content
Merged
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 RegalyticsRegulatoryArticle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class RegalyticsRegulatoryArticle : BaseData
public DateTime? RuleEffectiveDate { get; set; }

[JsonProperty(PropertyName = "sourced_at")]
public DateTime SourcedAt { get; set; }
public DateTime? SourcedAt { get; set; }

[JsonProperty(PropertyName = "latest_update")]
public DateTime LatestUpdate { get; set; }
Expand Down
7 changes: 5 additions & 2 deletions process.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
article['in_federal_register'] = 'yes' in article['in_federal_register'].lower()
# State -> Dictionary<string, List<string>>
states = {}
for agency in article.get('agencies', []):
agencies = article.get('agencies', [])
if not agencies:
agencies = []
for agency in agencies:
state = agency.get('state')
if not state:
continue
Expand All @@ -68,7 +71,7 @@
country_states.extend([x['name'] for x in state])

article['states'] = states
article['agencies'] = [agency['name'] for agency in article['agencies']]
article['agencies'] = [agency['name'] for agency in agencies]

# search using `created_at` returns all with UTC time between 00:00-23:59 in a single day,
# so it include some articles created at 20:00-00:00 in EST of the "previous day" (-04:00).
Expand Down
4 changes: 2 additions & 2 deletions tests/RegalyticsRegulatoryArticleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ public void CloneCollection()
public void BackwardCompatibilityToV2()
{
// The Id is a number in v2
var line = "{\"id\": 2051381, \"title\": \"House of Representatives Study Bill HSB692: A bill for an act relating to school security, including by modifying provisions related to the issuance of school bonds, requiring schools to conduct school safety reviews and have access to the statewide interoperable communications system, establishing the school emergency radio access grant program and the firearm detection software grant program within the department of homeland security and emergency management, requiring the department of public (I)\", \"summary\": \"Introduced on 2024-02-12. House Study Bill 692 is a piece of legislation in Iowa that focuses on school security. It includes provisions related to the issuance of school bonds, requires schools to conduct safety reviews and have access to a statewide communications system, establishes grant programs for school emergency radio access and firearm detection software, and requires the Department of Public Safety to convene a task force on school safety standards. The bill also appropriates funds for these programs and specifies that the state cost of compliance with the legislation will be paid by school districts from state school foundation aid. The bill takes effect upon enactment. (99IA202320242022HSB692)\", \"status\": \"New\", \"classification\": \"State\", \"filing_type\": \"Single\", \"in_federal_register\": false, \"federal_register_number\": null, \"regalytics_alert_id\": \"99IA2022HSB69225120240212\", \"proposed_comments_due_date\": null, \"original_publication_date\": \"2024-02-12\", \"federal_register_publication_date\": null, \"rule_effective_date\": null, \"latest_update\": \"2024-02-12\", \"alert_type\": \"Study Bill\", \"docket_file_number\": \"\", \"order_notice\": \"\", \"sec_release_number\": \"\", \"agencies\": [\"Iowa House of Representatives\"], \"sector_type\": [{\"name\": \"Financial\"}], \"tags\": [{\"name\": \"All State and Federal Legislatures\"}, {\"name\": \"Introduced Bill\"}], \"subtype_classification\": [{\"name\": \"House of Representatives Study Bill\", \"higher_order_alert_classification\": {\"name\": \"Rule\"}}], \"pdf_url\": \"https://www.legis.iowa.gov/legislation/BillBook?ga=90&ba=HSB692\", \"created_at\": \"2024-02-12T22:31:40.567008\", \"states\": {\"United States\": [\"Iowa\"]}}";
var line = "{\"id\": 2051381, \"title\": \"House of Representatives Study Bill HSB692: A bill for an act relating to school security, including by modifying provisions related to the issuance of school bonds, requiring schools to conduct school safety reviews and have access to the statewide interoperable communications system, establishing the school emergency radio access grant program and the firearm detection software grant program within the department of homeland security and emergency management, requiring the department of public (I)\", \"summary\": \"Introduced on 2024-02-12. House Study Bill 692 is a piece of legislation in Iowa that focuses on school security. It includes provisions related to the issuance of school bonds, requires schools to conduct safety reviews and have access to a statewide communications system, establishes grant programs for school emergency radio access and firearm detection software, and requires the Department of Public Safety to convene a task force on school safety standards. The bill also appropriates funds for these programs and specifies that the state cost of compliance with the legislation will be paid by school districts from state school foundation aid. The bill takes effect upon enactment. (99IA202320242022HSB692)\", \"status\": \"New\", \"classification\": \"State\", \"filing_type\": \"Single\", \"in_federal_register\": false, \"federal_register_number\": null, \"regalytics_alert_id\": \"99IA2022HSB69225120240212\", \"proposed_comments_due_date\": null, \"original_publication_date\": \"2024-02-12\", \"federal_register_publication_date\": null, \"rule_effective_date\": null, \"latest_update\": \"2024-02-12\", \"alert_type\": \"Study Bill\", \"docket_file_number\": \"\", \"order_notice\": \"\", \"sec_release_number\": \"\", \"agencies\": [\"Iowa House of Representatives\"], \"sector_type\": [{\"name\": \"Financial\"}], \"tags\": [{\"name\": \"All State and Federal Legislatures\"}, {\"name\": \"Introduced Bill\"}], \"subtype_classification\": [{\"name\": \"House of Representatives Study Bill\", \"higher_order_alert_classification\": {\"name\": \"Rule\"}}], \"pdf_url\": \"https://www.legis.iowa.gov/legislation/BillBook?ga=90&ba=HSB692\", \"created_at\": \"2024-02-12T22:31:40.567008\", \"sourced_at\": null, \"states\": {\"United States\": [\"Iowa\"]}}";
var instance = new RegalyticsRegulatoryArticle();
var config = new SubscriptionDataConfig(instance.GetType(), Symbol.None, Resolution.Daily, TimeZones.Utc, TimeZones.Utc, false, false, false);
var data = instance.Reader(config, line, new DateTime(2024, 2, 12), false) as RegalyticsRegulatoryArticle;
Assert.AreEqual("2051381", data.Id);
Assert.AreEqual(DateTime.MinValue, data.SourcedAt);
Assert.IsNull(data.SourcedAt);
}

private void AssertAreEqual(object expected, object result, bool filterByCustomAttributes = false)
Expand Down