Skip to content

Inconsistent ABS URLs for previous releases #264

@henrymcmillan

Description

@henrymcmillan

Hey Matt. release_date in read_abs doesn't work for some time series catalogues. I was trying to get a historical edition of Victorian GSP which has a financial year release. Here's the code that errors out:

read_abs(series_id = "A2478275V", release_date = "2023-11-21")

The error occurs because because lines 274 to 279 of R/read_abs.R convert latest release to a month code instead of a financial year code:

  • Original: .../australian-national-accounts-state-accounts/latest-release/5220003_annual_vic.xlsx
  • Converted: .../australian-national-accounts-state-accounts/nov-2023/5220003_annual_vic.xlsx
  • Correct: .../australian-national-accounts-state-accounts/2022-23-financial-year/5220003_annual_vic.xlsx

I started making a pull request which replaced 'latest-release' with something different based on the time series directory frequency and series end (to differentiate calendar year from financial year and different versions of quarterly) but quickly realised that the ABS have inconsistent naming schemes for previous releases. For example, state account financial years are formatted as 2022-23-financial-year whereas financial year supplementary trade is 2021-22.

At the moment, I cannot conceive of a good fix to this problem short of indexing all previous releases somewhere. I think the best way forward would be to add error handling and a tweak to the documentation to note that release_date only works for monthly releases. As far as can tell, none of the new ABS APIs support historical releases and the time series directory only points to the latest version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions